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