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

Side by Side Diff: test/mjsunit/regress/regress-4825.js

Issue 1778023004: [runtime] fix getting element keys from SLOW_SLOPPY_ARGUMENTS_ELEMENTS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix a few related bugs Created 4 years, 9 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
« src/elements.cc ('K') | « src/elements.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
(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 (function() {
6 function slowSloppyArgumentsElements(a, b, c) {
7 arguments[10000] = 1;
8 return Object.keys(arguments);
9 }
10 assertEquals(["0", "1", "2", "10000"], slowSloppyArgumentsElements(1, 2, 3));
11
12 function slowSloppyArguments(a, b, c) {
13 arguments[10000] = 1;
14 return arguments;
15 }
16
17 var args = slowSloppyArguments(1,2,3);
18 var keys = [];
19 for (var key in args) keys.push(key);
20
21 assertEquals(["0", "1", "2", "10000"], keys);
22 })();
23
24 (function() {
25 function slowSloppyArgumentsElements2(a, b, c) {
26 Object.defineProperty(arguments, 10000, {
27 enumerable: false, configurable: false, value: "NOPE"
28 });
29 return Object.keys(arguments);
30 }
31 assertEquals(["0", "1", "2"], slowSloppyArgumentsElements2(1, 2, 3));
32
33 function slowSloppyArguments2(a, b, c) {
34 Object.defineProperty(arguments, 10000, {
35 enumerable: false, configurable: false, value: "NOPE"
36 });
37 return arguments;
38 }
39
40 var args = slowSloppyArguments2(1,2,3);
41 var keys = [];
42 for (var key in args) keys.push(key);
43
44 assertEquals(["0", "1", "2"], keys);
45 })();
Camillo Bruni 2016/03/10 09:15:14 Nice tests! Could you create a second set with a l
caitp (gmail) 2016/03/10 16:58:34 Done
OLDNEW
« src/elements.cc ('K') | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698