Skip to content

Commit 72d78b7

Browse files
authored
Merge pull request #1331 from minseok-choe/fix/issue-array-from
2 parents 00c5831 + afb097d commit 72d78b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core-js/internals/array-from.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
2626
var length, result, step, iterator, next, value;
2727
// if the target is not iterable or it's an array with the default iterator - use a simple case
2828
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
29+
result = IS_CONSTRUCTOR ? new this() : [];
2930
iterator = getIterator(O, iteratorMethod);
3031
next = iterator.next;
31-
result = IS_CONSTRUCTOR ? new this() : [];
3232
for (;!(step = call(next, iterator)).done; index++) {
3333
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
3434
createProperty(result, index, value);

0 commit comments

Comments
 (0)