mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 16:35:14 +00:00
21 lines
666 B
JavaScript
21 lines
666 B
JavaScript
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
var create = require('../internals/object-create');
|
|
var definePropertyModule = require('../internals/object-define-property');
|
|
|
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
var ArrayPrototype = Array.prototype;
|
|
|
|
// Array.prototype[@@unscopables]
|
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
|
|
configurable: true,
|
|
value: create(null)
|
|
});
|
|
}
|
|
|
|
// add a key to Array.prototype[@@unscopables]
|
|
module.exports = function (key) {
|
|
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
};
|