Passing test for null resumption.
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 11 May 2011 15:04:08 -0500
changeset 74421 453701d5c7e7000b2f3ac3f58ce967ddbfe600d2
parent 74420 b9a24ec22039f52e32c7c06a286b81cc39cfd258
child 74422 ddab2f5eb8df82b549b4c94c925569c9f3b57c0f
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone6.0a1
Passing test for null resumption.
js/src/jit-test/tests/debug/resumption-05.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/debug/resumption-05.js
@@ -0,0 +1,38 @@
+// |jit-test| debug
+// null resumption value means terminate the debuggee
+
+var g = newGlobal('new-compartment');
+g.debuggeeGlobal = this;
+g.eval("(" + function () { 
+        var dbg = new Debug(debuggeeGlobal);
+        dbg.hooks = {
+            debuggerHandler: function (frame) {
+                if (frame.callee === null) {
+                    // The first debugger statement below.
+                    debuggeeGlobal.log += "1";
+                    var cv = frame.eval("f();");
+                    assertEq(cv, null);
+                    debuggeeGlobal.log += "2";
+                } else {
+                    // The second debugger statement.
+                    debuggeeGlobal.log += "3";
+                    assertEq(frame.callee.name, "f");
+                    return null;
+                }
+            }
+        };
+    } + ")()");
+
+var log = "";
+debugger;
+
+function f() {
+    log += "4";
+    try {
+        debugger;  // the debugger terminates us here
+    } finally {
+        log += "5";  // this should not execute
+    }
+}
+
+assertEq(log, "1432");