diff --git a/test/mjsunit/es6/mirror-collections.js b/test/mjsunit/es6/mirror-collections.js index 81a98b8a58..4232ef91cb 100644 --- a/test/mjsunit/es6/mirror-collections.js +++ b/test/mjsunit/es6/mirror-collections.js @@ -88,16 +88,21 @@ assertEquals(1, setMirror.values(1).length); assertSame(o2, values[0]); assertEquals(undefined, values[1]); +function initWeakMap(weakMap) { + weakMap.set(o1, 11); + weakMap.set(new Object(), 22); + weakMap.set(o3, 33); + weakMap.set(new Object(), 44); + var weakMapMirror = debug.MakeMirror(weakMap); + testMapMirror(weakMapMirror); + weakMap.set(new Object(), 55); + assertTrue(weakMapMirror.entries().length <= 5); + return weakMapMirror; +} + // Test the mirror object for WeakMaps var weakMap = new WeakMap(); -weakMap.set(o1, 11); -weakMap.set(new Object(), 22); -weakMap.set(o3, 33); -weakMap.set(new Object(), 44); -var weakMapMirror = debug.MakeMirror(weakMap); -testMapMirror(weakMapMirror); -weakMap.set(new Object(), 55); -assertTrue(weakMapMirror.entries().length <= 5); +var weakMapMirror = initWeakMap(weakMap); gc(); function testWeakMapEntries(weakMapMirror) { @@ -121,18 +126,23 @@ function testWeakMapEntries(weakMapMirror) { testWeakMapEntries(weakMapMirror); +function initWeakSet(weakSet) { + weakSet.add(o1); + weakSet.add(new Object()); + weakSet.add(o2); + weakSet.add(new Object()); + weakSet.add(new Object()); + weakSet.add(o3); + weakSet.delete(o2); + var weakSetMirror = debug.MakeMirror(weakSet); + testSetMirror(weakSetMirror); + assertTrue(weakSetMirror.values().length <= 5); + return weakSetMirror; +} + // Test the mirror object for WeakSets var weakSet = new WeakSet(); -weakSet.add(o1); -weakSet.add(new Object()); -weakSet.add(o2); -weakSet.add(new Object()); -weakSet.add(new Object()); -weakSet.add(o3); -weakSet.delete(o2); -var weakSetMirror = debug.MakeMirror(weakSet); -testSetMirror(weakSetMirror); -assertTrue(weakSetMirror.values().length <= 5); +var weakSetMirror = initWeakSet(weakSet); gc(); function testWeakSetValues(weakSetMirror) { diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index c9603b3ddb..c5ed38befe 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -314,10 +314,6 @@ # till it is optimized. So test timeouts. 'array-literal-transitions': [PASS, NO_IGNITION], - # TODO(mythria, 4680): Relate to GC and ignition holding references to - # objects. - 'es6/mirror-collections': [PASS, NO_IGNITION], - # TODO(rmcilroy, 4680): Script throws RangeError as expected, but does so during # eager compile of the whole script instead of during lazy compile of the function # f(), so we can't catch the exception in the try/catch. Skip because on some @@ -890,10 +886,6 @@ # till it is optimized. So test timeouts. 'array-literal-transitions': [SKIP], - # TODO(mythria, 4680): Relate to GC and ignition holding references to - # objects. - 'es6/mirror-collections': [FAIL], - # TODO(rmcilroy, 4680): Script throws RangeError as expected, but does so during # eager compile of the whole script instead of during lazy compile of the function # f(), so we can't catch the exception in the try/catch. Skip because on some