node_modules/es-abstract/2023/IsGenericDescriptor.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2023/IsGenericDescriptor.js in immosquare-cleaner-0.1.38

- old
+ new

@@ -1,20 +1,23 @@ 'use strict'; -var assertRecord = require('../helpers/assertRecord'); +var $TypeError = require('es-errors/type'); var IsAccessorDescriptor = require('./IsAccessorDescriptor'); var IsDataDescriptor = require('./IsDataDescriptor'); -var Type = require('./Type'); +var isPropertyDescriptor = require('../helpers/records/property-descriptor'); + // https://262.ecma-international.org/6.0/#sec-isgenericdescriptor module.exports = function IsGenericDescriptor(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 (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { return true; }