2019-09-25 13:30:05 +05:30
|
|
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
|
var create = require('../internals/object-create');
|
2019-10-31 01:37:42 +05:30
|
|
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
2019-09-25 13:30:05 +05:30
|
|
|
|
|
|
|
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
|
|
var ArrayPrototype = Array.prototype;
|
|
|
|
|
|
|
|
// Array.prototype[@@unscopables]
|
|
|
|
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
|
|
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
2019-10-31 01:37:42 +05:30
|
|
|
createNonEnumerableProperty(ArrayPrototype, UNSCOPABLES, create(null));
|
2019-09-25 13:30:05 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// add a key to Array.prototype[@@unscopables]
|
|
|
|
module.exports = function (key) {
|
|
|
|
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
|
|
};
|