PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Debugger-debuggees-04.js

http://github.com/zpao/v8monkey
JavaScript | 26 lines | 22 code | 3 blank | 1 comment | 2 complexity | f3a6ee52097304b7e4b6bfed0b801f70 MD5 | raw file
 1// hasDebuggee tests.
 2
 3var g1 = newGlobal('new-compartment'), g1w;
 4g1.eval("var g2 = newGlobal('same-compartment')");
 5var g2 = g1.g2;
 6var g1w, g2w;
 7
 8var dbg = new Debugger;
 9function checkHas(hasg1, hasg2) {
10    assertEq(dbg.hasDebuggee(g1), hasg1);
11    if (typeof g1w === 'object')
12        assertEq(dbg.hasDebuggee(g1w), hasg1);
13    assertEq(dbg.hasDebuggee(g2), hasg2);
14    if (typeof g2w === 'object')
15        assertEq(dbg.hasDebuggee(g2w), hasg2);
16}
17
18checkHas(false, false);
19g1w = dbg.addDebuggee(g1);
20checkHas(true, false);
21g2w = dbg.addDebuggee(g2);
22checkHas(true, true);
23dbg.removeDebuggee(g1w);
24checkHas(false, true);
25dbg.removeDebuggee(g2);
26checkHas(false, false);