es.object.get-own-property-symbols.js 890 B

123456789101112131415161718
  1. var $ = require('../internals/export');
  2. var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
  3. var fails = require('../internals/fails');
  4. var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');
  5. var toObject = require('../internals/to-object');
  6. // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  7. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  8. var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
  9. // `Object.getOwnPropertySymbols` method
  10. // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
  11. $({ target: 'Object', stat: true, forced: FORCED }, {
  12. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  13. var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  14. return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
  15. }
  16. });