node_modules/es-abstract/2018/ArraySetLength.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2018/ArraySetLength.js in immosquare-cleaner-0.1.38

- old
+ new

@@ -1,37 +1,29 @@ 'use strict'; -var GetIntrinsic = require('get-intrinsic'); +var $RangeError = require('es-errors/range'); +var $TypeError = require('es-errors/type'); -var $RangeError = GetIntrinsic('%RangeError%'); -var $TypeError = GetIntrinsic('%TypeError%'); - var assign = require('object.assign'); -var isPropertyDescriptor = require('../helpers/isPropertyDescriptor'); +var isPropertyDescriptor = require('../helpers/records/property-descriptor'); var IsArray = require('./IsArray'); -var IsAccessorDescriptor = require('./IsAccessorDescriptor'); var IsDataDescriptor = require('./IsDataDescriptor'); var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty'); var OrdinaryGetOwnProperty = require('./OrdinaryGetOwnProperty'); var ToNumber = require('./ToNumber'); var ToString = require('./ToString'); var ToUint32 = require('./ToUint32'); -var Type = require('./Type'); // https://262.ecma-international.org/6.0/#sec-arraysetlength // eslint-disable-next-line max-statements, max-lines-per-function module.exports = function ArraySetLength(A, Desc) { if (!IsArray(A)) { throw new $TypeError('Assertion failed: A must be an Array'); } - if (!isPropertyDescriptor({ - Type: Type, - IsDataDescriptor: IsDataDescriptor, - IsAccessorDescriptor: IsAccessorDescriptor - }, Desc)) { + if (!isPropertyDescriptor(Desc)) { throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); } if (!('[[Value]]' in Desc)) { return OrdinaryDefineOwnProperty(A, 'length', Desc); }