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.

es.object.prevent-extensions.js 783B

123456789101112131415161718
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var isObject = require('../internals/is-object');
  4. var onFreeze = require('../internals/internal-metadata').onFreeze;
  5. var FREEZING = require('../internals/freezing');
  6. var fails = require('../internals/fails');
  7. // eslint-disable-next-line es/no-object-preventextensions -- safe
  8. var $preventExtensions = Object.preventExtensions;
  9. var FAILS_ON_PRIMITIVES = fails(function () { $preventExtensions(1); });
  10. // `Object.preventExtensions` method
  11. // https://tc39.es/ecma262/#sec-object.preventextensions
  12. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
  13. preventExtensions: function preventExtensions(it) {
  14. return $preventExtensions && isObject(it) ? $preventExtensions(onFreeze(it)) : it;
  15. }
  16. });