Index: test/mjsunit/debug-toggle-mirror-cache.js |
diff --git a/test/mjsunit/es6/regress/regress-cr372788.js b/test/mjsunit/debug-toggle-mirror-cache.js |
similarity index 78% |
copy from test/mjsunit/es6/regress/regress-cr372788.js |
copy to test/mjsunit/debug-toggle-mirror-cache.js |
index 9b66a7e08b3737cf26b0dc52e87f4e69bddbf729..a44c11551e02125fe8cd54b693c5ac6dee545721 100644 |
--- a/test/mjsunit/es6/regress/regress-cr372788.js |
+++ b/test/mjsunit/debug-toggle-mirror-cache.js |
@@ -25,21 +25,16 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Flags: --expose-debug-as debug |
-var x = 0; |
-var y = 0; |
+var handle1 = debug.MakeMirror(123).handle(); |
+assertEquals("number", debug.LookupMirror(handle1).type()); |
-var thenable = { then: function(f) { x++; f(); } }; |
+debug.ToggleMirrorCache(false); |
+var handle2 = debug.MakeMirror(123).handle(); |
+assertEquals(undefined, handle2); |
+assertThrows(function() { debug.LookupMirror(handle2) }); |
-for (var i = 0; i < 3; ++i) { |
- Promise.resolve(thenable).then(function() { x++; y++; }); |
-} |
-assertEquals(0, x); |
- |
-(function check() { |
- Promise.resolve().chain(function() { |
- // Delay check until all handlers have run. |
- if (y < 3) check(); else assertEquals(6, x); |
- }).catch(function(e) { %AbortJS("FAILURE: " + e) }); |
-})(); |
+debug.ToggleMirrorCache(true); |
+var handle3 = debug.MakeMirror(123).handle(); |
+assertEquals("number", debug.LookupMirror(handle3).type()); |