Index: src/js/typedarray.js |
diff --git a/src/js/typedarray.js b/src/js/typedarray.js |
index 8e7d9ee77e4ed3c8011e400c490e132cf6ef1664..ac4e842be2d81481f82a7a9be410a9ced4272566 100644 |
--- a/src/js/typedarray.js |
+++ b/src/js/typedarray.js |
@@ -263,18 +263,17 @@ |
if (!IS_UNDEFINED(new.target)) { |
if (IS_ARRAYBUFFER(arg1) || IS_SHAREDARRAYBUFFER(arg1)) { |
NAMEConstructByArrayBuffer(this, arg1, arg2, arg3); |
- } else if (IS_NUMBER(arg1) || IS_STRING(arg1) || |
- IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) { |
- NAMEConstructByLength(this, arg1); |
} else if (IS_TYPEDARRAY(arg1)) { |
NAMEConstructByTypedArray(this, arg1); |
- } else { |
+ } else if (IS_RECEIVER(arg1)) { |
var iteratorFn = arg1[iteratorSymbol]; |
if (IS_UNDEFINED(iteratorFn) || iteratorFn === ArrayValues) { |
NAMEConstructByArrayLike(this, arg1, arg1.length); |
} else { |
NAMEConstructByIterable(this, arg1, iteratorFn); |
} |
+ } else { |
+ NAMEConstructByLength(this, arg1); |
} |
} else { |
throw MakeTypeError(kConstructorNotFunction, "NAME") |