es.object.is-extensible.js 550 B

1234567891011121314
  1. var $ = require('../internals/export');
  2. var fails = require('../internals/fails');
  3. var isObject = require('../internals/is-object');
  4. var nativeIsExtensible = Object.isExtensible;
  5. var FAILS_ON_PRIMITIVES = fails(function () { nativeIsExtensible(1); });
  6. // `Object.isExtensible` method
  7. // https://tc39.github.io/ecma262/#sec-object.isextensible
  8. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  9. isExtensible: function isExtensible(it) {
  10. return isObject(it) ? nativeIsExtensible ? nativeIsExtensible(it) : true : false;
  11. }
  12. });