PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/debug/resumption-05.js

http://github.com/zpao/v8monkey
JavaScript | 36 lines | 28 code | 4 blank | 4 comment | 2 complexity | eba6093cc75a80eee4a3cc716d4e549b MD5 | raw file
 1// |jit-test| debug
 2// null resumption value means terminate the debuggee
 3
 4var g = newGlobal('new-compartment');
 5g.debuggeeGlobal = this;
 6g.eval("(" + function () { 
 7        var dbg = new Debugger(debuggeeGlobal);
 8        dbg.onDebuggerStatement = function (frame) {
 9            if (frame.callee === null) {
10                // The first debugger statement below.
11                debuggeeGlobal.log += "1";
12                var cv = frame.eval("f();");
13                assertEq(cv, null);
14                debuggeeGlobal.log += "2";
15            } else {
16                // The second debugger statement.
17                debuggeeGlobal.log += "3";
18                assertEq(frame.callee.name, "f");
19                return null;
20            }
21        };
22    } + ")()");
23
24var log = "";
25debugger;
26
27function f() {
28    log += "4";
29    try {
30        debugger;  // the debugger terminates us here
31    } finally {
32        log += "5";  // this should not execute
33    }
34}
35
36assertEq(log, "1432");