first
This commit is contained in:
21
node_modules/core-js/internals/add-to-unscopables.js
generated
vendored
Normal file
21
node_modules/core-js/internals/add-to-unscopables.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
var wellKnownSymbol = require('../internals/well-known-symbol');
|
||||
var create = require('../internals/object-create');
|
||||
var defineProperty = require('../internals/object-define-property').f;
|
||||
|
||||
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
||||
var ArrayPrototype = Array.prototype;
|
||||
|
||||
// Array.prototype[@@unscopables]
|
||||
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
||||
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
||||
defineProperty(ArrayPrototype, UNSCOPABLES, {
|
||||
configurable: true,
|
||||
value: create(null)
|
||||
});
|
||||
}
|
||||
|
||||
// add a key to Array.prototype[@@unscopables]
|
||||
module.exports = function (key) {
|
||||
ArrayPrototype[UNSCOPABLES][key] = true;
|
||||
};
|
Reference in New Issue
Block a user