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

Side by Side Diff: test/mjsunit/regress/regress-crbug-412203.js

Issue 563733002: Fix regress-crbug-412203.js (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: better approach Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 6
7 var b = []; 7 var b = [];
8 b[10000] = 1; 8 b[10000] = 1;
9 // Required to reproduce the bug. 9 // Required to reproduce the bug.
10 assertTrue(%HasDictionaryElements(b)); 10 assertTrue(%HasDictionaryElements(b));
11 11
12 var a1 = [1.5]; 12 var a1 = [1.5];
13 b.__proto__ = a1; 13 b.__proto__ = a1;
14 assertEquals(1.5, ([].concat(b))[0]); 14 assertEquals(1.5, ([].concat(b))[0]);
15 15
16 var a2 = new Int32Array(2); 16 var a2 = new Int32Array(2);
17 a2[0] = 3; 17 a2[0] = 3;
18 b.__proto__ = a2 18 b.__proto__ = a2
19 assertEquals(3, ([].concat(b))[0]); 19 assertEquals(3, ([].concat(b))[0]);
20 20
21 function foo(x, y) { 21 function foo(x, y) {
22 var a = []; 22 var a = [];
23 a[10000] = 1; 23 a[10000] = 1;
24 assertTrue(%HasDictionaryElements(a)); 24 assertTrue(%HasDictionaryElements(a));
25 25
26 a.__proto__ = arguments; 26 a.__proto__ = arguments;
27 var c = [].concat(a); 27 var c = [].concat(a);
28 assertEquals(2, c[0]); 28 for (var i = 0; i < arguments.length; i++) {
29 assertEquals(undefined, c[1]); 29 assertEquals(i + 2, c[i]);
30 }
31 assertEquals(undefined, c[arguments.length]);
32 assertEquals(undefined, c[arguments.length + 1]);
30 } 33 }
31 foo(2); 34 foo(2);
35 foo(2, 3);
36 foo(2, 3, 4);
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698