Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

add-to-unscopables.js 669B

123456789101112131415161718192021
  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. var UNSCOPABLES = wellKnownSymbol('unscopables');
  6. var ArrayPrototype = Array.prototype;
  7. // Array.prototype[@@unscopables]
  8. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  9. if (ArrayPrototype[UNSCOPABLES] === undefined) {
  10. defineProperty(ArrayPrototype, UNSCOPABLES, {
  11. configurable: true,
  12. value: create(null)
  13. });
  14. }
  15. // add a key to Array.prototype[@@unscopables]
  16. module.exports = function (key) {
  17. ArrayPrototype[UNSCOPABLES][key] = true;
  18. };