Index: test/mjsunit/regress/regress-2186.js |
diff --git a/test/mjsunit/regress/regress-2034.js b/test/mjsunit/regress/regress-2186.js |
similarity index 79% |
copy from test/mjsunit/regress/regress-2034.js |
copy to test/mjsunit/regress/regress-2186.js |
index c510f97fc3030612457a72b3fa144f134e426668..0921dceadb2d0f8dc621c437aac3e064ea72b2c4 100644 |
--- a/test/mjsunit/regress/regress-2034.js |
+++ b/test/mjsunit/regress/regress-2186.js |
@@ -27,20 +27,23 @@ |
// Flags: --harmony-collections |
-var key = {}; |
-var map = new WeakMap; |
-Object.preventExtensions(key); |
+function heapify(i) { |
+ return 2.0 * (i / 2); |
+} |
+heapify(1); |
-// Try querying using frozen key. |
-assertFalse(map.has(key)); |
-assertSame(undefined, map.get(key)); |
+var ONE = 1; |
+var ANOTHER_ONE = heapify(ONE); |
+assertSame(ONE, ANOTHER_ONE); |
+assertEquals("number", typeof ONE); |
+assertEquals("number", typeof ANOTHER_ONE); |
-// Try adding using frozen key. |
-map.set(key, 1); |
-assertTrue(map.has(key)); |
-assertSame(1, map.get(key)); |
+var set = new Set; |
+set.add(ONE); |
+assertTrue(set.has(ONE)); |
+assertTrue(set.has(ANOTHER_ONE)); |
-// Try deleting using frozen key. |
-map.delete(key, 1); |
-assertFalse(map.has(key)); |
-assertSame(undefined, map.get(key)); |
+var map = new Map; |
+map.set(ONE, 23); |
+assertSame(23, map.get(ONE)); |
+assertSame(23, map.get(ANOTHER_ONE)); |