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

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

Issue 2091153002: TypedArray.prototype.set uses internal length property, not real one. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2016 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 descriptor = { get: function() { throw new Error("accessed length"); } };
18
19 for (var constructor of typedArrayConstructors) {
20 var differentConstructor = constructor === Uint8Array ? Int8Array : Uint8Array ;
21 var target = new constructor(16);
22 Object.defineProperty(target, "length", descriptor);
23
24 var sameBuffer = new differentConstructor(target.buffer, 0, 2);
25 Object.defineProperty(sameBuffer, "length", descriptor);
26 target.set(sameBuffer);
27
28 var differentBuffer = new differentConstructor(16);
29 Object.defineProperty(differentBuffer, "length", descriptor);
30 target.set(differentBuffer);
31
32 var array = [0, 1, 2];
33 target.set(array);
34 }
OLDNEW
« src/js/typedarray.js ('K') | « src/js/typedarray.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698