~ubuntu-branches/ubuntu/saucy/mozjs17/saucy

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// hasDebuggee tests.
 
2
 
 
3
var g1 = newGlobal('new-compartment'), g1w;
 
4
g1.eval("var g2 = newGlobal('same-compartment')");
 
5
var g2 = g1.g2;
 
6
var g1w, g2w;
 
7
 
 
8
var dbg = new Debugger;
 
9
function 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
 
 
18
checkHas(false, false);
 
19
g1w = dbg.addDebuggee(g1);
 
20
checkHas(true, false);
 
21
g2w = dbg.addDebuggee(g2);
 
22
checkHas(true, true);
 
23
dbg.removeDebuggee(g1w);
 
24
checkHas(false, true);
 
25
dbg.removeDebuggee(g2);
 
26
checkHas(false, false);