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