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
|
|
|
|
|
|
|
var $Object = GetIntrinsic('%Object%');
|
|
|
|
|
|
|
|
var isPrimitive = require('../helpers/isPrimitive');
|
|
|
|
|
|
|
|
var $preventExtensions = $Object.preventExtensions;
|
|
|
|
var $isExtensible = $Object.isExtensible;
|
|
|
|
|
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);
|
|
|
|
};
|