| Index: src/typedarray.js
|
| diff --git a/src/typedarray.js b/src/typedarray.js
|
| index 7bd16f670b4425b88319676a52374c480b5b2477..ec9849df699a3ac69b5e52492ec441446f05fc2b 100644
|
| --- a/src/typedarray.js
|
| +++ b/src/typedarray.js
|
| @@ -69,6 +69,9 @@ function CreateTypedArrayConstructor(name, elementSize, arrayId, constructor) {
|
|
|
| function ConstructByLength(obj, length) {
|
| var l = ToPositiveInteger(length, "invalid_typed_array_length");
|
| + if (l > %MaxSmi()) {
|
| + throw MakeRangeError("invalid_typed_array_length");
|
| + }
|
| var byteLength = l * elementSize;
|
| var buffer = new global.ArrayBuffer(byteLength);
|
| %TypedArrayInitialize(obj, arrayId, buffer, 0, byteLength);
|
|
|