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

Side by Side Diff: test/mjsunit/regress/regress-4665-2.js

Issue 1678123002: Extend subarray web compatibility fix to --harmony-species (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/js/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
1 // Copyright 2015 the V8 project authors. All rights reserved. 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 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 // Flags: --noharmony-species 5 // Flags: --harmony-species
6 6
7 // First test case 7 // First test case
8 8
9 function FirstBuffer () {} 9 function FirstBuffer () {}
10 FirstBuffer.prototype.__proto__ = Uint8Array.prototype 10 FirstBuffer.prototype.__proto__ = Uint8Array.prototype
11 FirstBuffer.__proto__ = Uint8Array 11 FirstBuffer.__proto__ = Uint8Array
12 12
13 var buf = new Uint8Array(10) 13 var buf = new Uint8Array(10)
14 buf.__proto__ = FirstBuffer.prototype 14 buf.__proto__ = FirstBuffer.prototype
15 15
16 var buf2 = buf.subarray(2) 16 var buf2 = buf.subarray(2)
17 assertEquals(8, buf2.length); 17 assertEquals(8, buf2.length);
18 18
19 // Second test case 19 // Second test case
20 20
21 function SecondBuffer (arg) { 21 function SecondBuffer (arg) {
22 var arr = new Uint8Array(arg) 22 var arr = new Uint8Array(arg)
23 arr.__proto__ = SecondBuffer.prototype 23 arr.__proto__ = SecondBuffer.prototype
24 return arr 24 return arr
25 } 25 }
26 SecondBuffer.prototype.__proto__ = Uint8Array.prototype 26 SecondBuffer.prototype.__proto__ = Uint8Array.prototype
27 SecondBuffer.__proto__ = Uint8Array 27 SecondBuffer.__proto__ = Uint8Array
28 28
29 var buf3 = new SecondBuffer(10) 29 var buf3 = new SecondBuffer(10)
30 30
31 var buf4 = buf3.subarray(2) 31 var buf4 = buf3.subarray(2)
32 32
33 assertEquals(8, buf4.length); 33 assertEquals(8, buf4.length);
OLDNEW
« no previous file with comments | « src/js/typedarray.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698