Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/typedarray.js

Issue 1237583005: Only evaluate length once in %TypedArray%.prototype.set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add more cases to the test Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/typedarray-set-length.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 })
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/typedarray-set-length.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698