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); |