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.reflect.prevent-extensions.js 673B

1234567891011121314151617181920
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var getBuiltIn = require('../internals/get-built-in');
  4. var anObject = require('../internals/an-object');
  5. var FREEZING = require('../internals/freezing');
  6. // `Reflect.preventExtensions` method
  7. // https://tc39.es/ecma262/#sec-reflect.preventextensions
  8. $({ target: 'Reflect', stat: true, sham: !FREEZING }, {
  9. preventExtensions: function preventExtensions(target) {
  10. anObject(target);
  11. try {
  12. var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions');
  13. if (objectPreventExtensions) objectPreventExtensions(target);
  14. return true;
  15. } catch (error) {
  16. return false;
  17. }
  18. }
  19. });