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.

object-is-extensible.js 789B

1234567891011121314151617
  1. 'use strict';
  2. var fails = require('../internals/fails');
  3. var isObject = require('../internals/is-object');
  4. var classof = require('../internals/classof-raw');
  5. var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible');
  6. // eslint-disable-next-line es/no-object-isextensible -- safe
  7. var $isExtensible = Object.isExtensible;
  8. var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
  9. // `Object.isExtensible` method
  10. // https://tc39.es/ecma262/#sec-object.isextensible
  11. module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
  12. if (!isObject(it)) return false;
  13. if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false;
  14. return $isExtensible ? $isExtensible(it) : true;
  15. } : $isExtensible;