Chromium Code Reviews| Index: src/typedarray.js |
| diff --git a/src/typedarray.js b/src/typedarray.js |
| index ee1fa9d4f1e22aa5b7e7a54604f3e0bf5d465b55..0d14558d4ade594b733c26aedd39d217ce49ab54 100644 |
| --- a/src/typedarray.js |
| +++ b/src/typedarray.js |
| @@ -154,6 +154,12 @@ function TypedArraySet(obj, offset) { |
| var l = obj.length; |
| if (IS_UNDEFINED(l)) { |
| + if (IS_NUMBER(obj)) |
|
Benedikt Meurer
2013/07/16 05:39:57
This if is missing { and }.
|
| + // For number as a first argument, throw TypeError |
| + // instead of silently ignoring the call, so that |
| + // the user knows (s)he did something wrong. |
| + // (Consistent with Firefox and Blink/WebKit) |
| + throw MakeTypeError("invalid_argument"); |
| return; |
| } |
| if (intOffset + l > this.length) { |