mirror of
https://github.com/musix-org/musix-oss
synced 2024-11-14 03:30:18 +00:00
18 lines
580 B
JavaScript
18 lines
580 B
JavaScript
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
var create = require('../internals/object-create');
|
|
var hide = require('../internals/hide');
|
|
|
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
var ArrayPrototype = Array.prototype;
|
|
|
|
// Array.prototype[@@unscopables]
|
|
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
hide(ArrayPrototype, UNSCOPABLES, create(null));
|
|
}
|
|
|
|
// add a key to Array.prototype[@@unscopables]
|
|
module.exports = function (key) {
|
|
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
};
|