node_modules/es-abstract/2018/IsAccessorDescriptor.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2018/IsAccessorDescriptor.js in immosquare-cleaner-0.1.38
- old
+ new
@@ -1,22 +1,24 @@
'use strict';
-var has = require('has');
+var $TypeError = require('es-errors/type');
-var Type = require('./Type');
+var hasOwn = require('hasown');
-var assertRecord = require('../helpers/assertRecord');
+var isPropertyDescriptor = require('../helpers/records/property-descriptor');
// https://262.ecma-international.org/5.1/#sec-8.10.1
module.exports = function IsAccessorDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return false;
}
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
+ if (!isPropertyDescriptor(Desc)) {
+ throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
+ }
- if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
+ if (!hasOwn(Desc, '[[Get]]') && !hasOwn(Desc, '[[Set]]')) {
return false;
}
return true;
};