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

Unified Diff: test/mjsunit/for-in.js

Issue 1707743002: [key-accumulator] Starting to reimplement the key-accumulator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use proper type 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-forin.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/for-in.js
diff --git a/test/mjsunit/for-in.js b/test/mjsunit/for-in.js
index 644c27a63277b25729734afb061a286f38e1e801..bece37a3ee35ea8630400812670d67f703c722ac 100644
--- a/test/mjsunit/for-in.js
+++ b/test/mjsunit/for-in.js
@@ -120,7 +120,23 @@ for (i=0 ; i < 3; ++i) {
assertEquals("undefined", typeof y[0], "y[0]");
}
-(function() {
+(function testLargeElementKeys() {
+ // Key out of SMI range but well within safe double representaion.
+ var large_key = 2147483650;
+ var o = [];
+ // Trigger dictionary elements with HeapNumber keys.
+ o[large_key] = 0;
+ o[large_key+1] = 1;
+ o[large_key+2] = 2;
+ o[large_key+3] = 3;
+ var keys = [];
+ for (var k in o) {
+ keys.push(k);
+ }
+ assertEquals(["2147483650", "2147483651", "2147483652", "2147483653"], keys);
+})();
+
+(function testLargeElementKeysWithProto() {
var large_key = 2147483650;
var o = {__proto__: {}};
o[large_key] = 1;
@@ -131,3 +147,17 @@ for (i=0 ; i < 3; ++i) {
}
assertEquals(["2147483650"], keys);
})();
+
+(function testNonEnumerableArgumentsIndex() {
+ Object.defineProperty(arguments, 0, {enumerable:false});
+ for (var k in arguments) {
+ assertUnreachable();
+ }
+})();
+
+(function testNonEnumerableSloppyArgumentsIndex(a) {
+ Object.defineProperty(arguments, 0, {enumerable:false});
+ for (var k in arguments) {
+ assertUnreachable();
+ }
+})(true);
« no previous file with comments | « src/runtime/runtime-forin.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698