PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Frame-identity-02.js

http://github.com/zpao/v8monkey
JavaScript | 22 lines | 17 code | 3 blank | 2 comment | 2 complexity | 0d7d8fcd8d36514ea52b56978fb66f2a MD5 | raw file
 1// |jit-test| debug
 2// Check that {throw:} resumption kills the current stack frame.
 3
 4load(libdir + "asserts.js");
 5
 6var g = newGlobal('new-compartment');
 7g.debuggeeGlobal = this;
 8g.eval("(" + function () {
 9        var dbg = new Debugger(debuggeeGlobal);
10        var prev = null;
11        dbg.onDebuggerStatement = function (frame) {
12            assertEq(frame === prev, false);
13            if (prev)
14                assertEq(prev.live, false);
15            prev = frame;
16            return {throw: debuggeeGlobal.i};
17        };
18    } + ")();");
19
20function f() { debugger; }
21for (var i = 0; i < 10; i++)
22    assertThrowsValue(f, i);