es.object.keys.js 462 B

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