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

/js/src/jit-test/tests/debug/onDebuggerStatement-02.js

http://github.com/zpao/v8monkey
JavaScript | 22 lines | 15 code | 6 blank | 1 comment | 0 complexity | b2907ccb300d80545c683036f2d371e2 MD5 | raw file
 1// Activity in the debugger compartment should not trigger debug hooks.
 2
 3var g = newGlobal('new-compartment');
 4var hit = false;
 5
 6var dbg = Debugger(g);
 7dbg.onDebuggerStatement = function (stack) { hit = true; };
 8
 9debugger;
10assertEq(hit, false, "raw debugger statement in debugger compartment should not hit");
11
12g.f = function () { debugger; };
13g.eval("f();");
14assertEq(hit, false, "debugger statement in debugger compartment function should not hit");
15
16g.outerEval = eval;
17g.eval("outerEval('debugger;');");
18assertEq(hit, false, "debugger statement in debugger compartment eval code should not hit");
19
20var g2 = newGlobal('new-compartment');
21g2.eval("debugger;");
22assertEq(hit, false, "debugger statement in unrelated non-debuggee compartment should not hit");