es.object.keys.js 476 B

123456789101112131415
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var toObject = require('../internals/to-object');
  4. var nativeKeys = require('../internals/object-keys');
  5. var fails = require('../internals/fails');
  6. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  7. // `Object.keys` method
  8. // https://tc39.es/ecma262/#sec-object.keys
  9. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  10. keys: function keys(it) {
  11. return nativeKeys(toObject(it));
  12. }
  13. });