Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/es-abstract/2020/CreateListFromArrayLike.js
r0c6b92a r79a0317 1 1 'use strict'; 2 2 3 var callBound = require('call-b ind/callBound');3 var callBound = require('call-bound'); 4 4 5 5 var $TypeError = require('es-errors/type'); … … 13 13 var Type = require('./Type'); 14 14 15 var isObject = require('../helpers/isObject'); 16 15 17 var defaultElementTypes = ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'BigInt', 'Object']; 16 18 17 19 // https://262.ecma-international.org/11.0/#sec-createlistfromarraylike 18 20 21 /** @type {(obj: object, elementTypes?: typeof defaultElementTypes) => unknown[]} */ 19 22 module.exports = function CreateListFromArrayLike(obj) { 20 23 var elementTypes = arguments.length > 1 … … 22 25 : defaultElementTypes; 23 26 24 if ( Type(obj) !== 'Object') {27 if (!isObject(obj)) { 25 28 throw new $TypeError('Assertion failed: `obj` must be an Object'); 26 29 } … … 29 32 } 30 33 var len = LengthOfArrayLike(obj); 34 /** @type {(typeof elementTypes)[]} */ 31 35 var list = []; 32 36 var index = 0;
Note:
See TracChangeset
for help on using the changeset viewer.