OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 if (IS_UNDEFINED(l)) { | 323 if (IS_UNDEFINED(l)) { |
324 if (IS_NUMBER(obj)) { | 324 if (IS_NUMBER(obj)) { |
325 // For number as a first argument, throw TypeError | 325 // For number as a first argument, throw TypeError |
326 // instead of silently ignoring the call, so that | 326 // instead of silently ignoring the call, so that |
327 // the user knows (s)he did something wrong. | 327 // the user knows (s)he did something wrong. |
328 // (Consistent with Firefox and Blink/WebKit) | 328 // (Consistent with Firefox and Blink/WebKit) |
329 throw MakeTypeError(kInvalidArgument); | 329 throw MakeTypeError(kInvalidArgument); |
330 } | 330 } |
331 return; | 331 return; |
332 } | 332 } |
| 333 l = $toLength(l); |
333 if (intOffset + l > this.length) { | 334 if (intOffset + l > this.length) { |
334 throw MakeRangeError(kTypedArraySetSourceTooLarge); | 335 throw MakeRangeError(kTypedArraySetSourceTooLarge); |
335 } | 336 } |
336 TypedArraySetFromArrayLike(this, obj, l, intOffset); | 337 TypedArraySetFromArrayLike(this, obj, l, intOffset); |
337 return; | 338 return; |
338 } | 339 } |
339 } | 340 } |
340 | 341 |
341 function TypedArrayGetToStringTag() { | 342 function TypedArrayGetToStringTag() { |
342 if (!%_IsTypedArray(this)) return; | 343 if (!%_IsTypedArray(this)) return; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 "setUint32", DataViewSetUint32JS, | 501 "setUint32", DataViewSetUint32JS, |
501 | 502 |
502 "getFloat32", DataViewGetFloat32JS, | 503 "getFloat32", DataViewGetFloat32JS, |
503 "setFloat32", DataViewSetFloat32JS, | 504 "setFloat32", DataViewSetFloat32JS, |
504 | 505 |
505 "getFloat64", DataViewGetFloat64JS, | 506 "getFloat64", DataViewGetFloat64JS, |
506 "setFloat64", DataViewSetFloat64JS | 507 "setFloat64", DataViewSetFloat64JS |
507 ]); | 508 ]); |
508 | 509 |
509 }) | 510 }) |
OLD | NEW |