node_modules/es-abstract/2023/ArraySpeciesCreate.js in immosquare-cleaner-0.1.60 vs node_modules/es-abstract/2023/ArraySpeciesCreate.js in immosquare-cleaner-0.1.61

- old
+ new

@@ -2,18 +2,18 @@ var GetIntrinsic = require('get-intrinsic'); var $species = GetIntrinsic('%Symbol.species%', true); var $TypeError = require('es-errors/type'); +var isInteger = require('math-intrinsics/isInteger'); var ArrayCreate = require('./ArrayCreate'); var Get = require('./Get'); var IsArray = require('./IsArray'); var IsConstructor = require('./IsConstructor'); -var Type = require('./Type'); -var isInteger = require('../helpers/isInteger'); +var isObject = require('../helpers/isObject'); // https://262.ecma-international.org/12.0/#sec-arrayspeciescreate module.exports = function ArraySpeciesCreate(originalArray, length) { if (!isInteger(length) || length < 0) { @@ -29,10 +29,10 @@ // TODO: figure out how to make a cross-realm normal Array, a same-realm Array // if (IsConstructor(C)) { // if C is another realm's Array, C = undefined // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? // } - if ($species && Type(C) === 'Object') { + if ($species && isObject(C)) { C = Get(C, $species); if (C === null) { C = void 0; } }