UNPKG

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