Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
666 bytes
|
Line | |
---|
1 | var wellKnownSymbol = require('../internals/well-known-symbol');
|
---|
2 | var create = require('../internals/object-create');
|
---|
3 | var definePropertyModule = require('../internals/object-define-property');
|
---|
4 |
|
---|
5 | var UNSCOPABLES = wellKnownSymbol('unscopables');
|
---|
6 | var ArrayPrototype = Array.prototype;
|
---|
7 |
|
---|
8 | // Array.prototype[@@unscopables]
|
---|
9 | // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
---|
10 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
---|
11 | definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
|
---|
12 | configurable: true,
|
---|
13 | value: create(null)
|
---|
14 | });
|
---|
15 | }
|
---|
16 |
|
---|
17 | // add a key to Array.prototype[@@unscopables]
|
---|
18 | module.exports = function (key) {
|
---|
19 | ArrayPrototype[UNSCOPABLES][key] = true;
|
---|
20 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.