blob: 14de356c5b56cd3ec1e279d61284f812df102403 [file] [log] [blame]
var wellKnownSymbol = require('../internals/well-known-symbol');
var create = require('../internals/object-create');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var UNSCOPABLES = wellKnownSymbol('unscopables');
var ArrayPrototype = Array.prototype;
// Array.prototype[@@unscopables]
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype[UNSCOPABLES] == undefined) {
createNonEnumerableProperty(ArrayPrototype, UNSCOPABLES, create(null));
}
// add a key to Array.prototype[@@unscopables]
module.exports = function (key) {
ArrayPrototype[UNSCOPABLES][key] = true;
};