es.object.get-own-property-names.js 577 B

12345678910111213
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var fails = require('../internals/fails');
  4. var getOwnPropertyNames = require('../internals/object-get-own-property-names-external').f;
  5. // eslint-disable-next-line es/no-object-getownpropertynames -- required for testing
  6. var FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); });
  7. // `Object.getOwnPropertyNames` method
  8. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  9. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  10. getOwnPropertyNames: getOwnPropertyNames
  11. });