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

Side by Side Diff: test/mjsunit/es6/typedarray-set-length.js

Issue 1237583005: Only evaluate length once in %TypedArray%.prototype.set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « src/typedarray.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var typedArrayConstructors = [
6 Uint8Array,
7 Int8Array,
8 Uint16Array,
9 Int16Array,
10 Uint32Array,
11 Int32Array,
12 Uint8ClampedArray,
13 Float32Array,
14 Float64Array
15 ];
16
17 var lengthCalled = false;
18 function lengthValue() {
19 assertFalse(lengthCalled);
20 lengthCalled = true;
21 return 5;
22 }
23
24 for (var constructor of typedArrayConstructors) {
25 lengthCalled = false;
26 var a = new constructor(10);
27 a.set({length: {valueOf: lengthValue}});
Dan Ehrenberg 2015/07/13 23:47:30 Just as a sanity check, test here that lengthCalle
28 }
OLDNEW
« no previous file with comments | « src/typedarray.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698