2020-08-25 23:57:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
2021-02-26 03:58:33 +00:00
|
|
|
var GetIntrinsic = require('get-intrinsic');
|
2020-08-25 23:57:08 +00:00
|
|
|
|
2022-11-10 10:43:16 +00:00
|
|
|
var $preventExtensions = GetIntrinsic('%Object.preventExtensions%', true);
|
|
|
|
var $isExtensible = GetIntrinsic('%Object.isExtensible%', true);
|
2020-08-25 23:57:08 +00:00
|
|
|
|
|
|
|
var isPrimitive = require('../helpers/isPrimitive');
|
|
|
|
|
2021-02-26 03:58:33 +00:00
|
|
|
// https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
|
2020-08-25 23:57:08 +00:00
|
|
|
|
|
|
|
module.exports = $preventExtensions
|
|
|
|
? function IsExtensible(obj) {
|
|
|
|
return !isPrimitive(obj) && $isExtensible(obj);
|
|
|
|
}
|
|
|
|
: function IsExtensible(obj) {
|
|
|
|
return !isPrimitive(obj);
|
|
|
|
};
|