summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-findScripts-10.js
blob: f8ab68dda72785f580304ac5995d68c4c005cc28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Specifying a non-debuggee global in a Debugger.prototype.findScripts query should
// cause the query to return no scripts.

var g1 = newGlobal({newCompartment: true});
g1.eval('function f(){}');

var g2 = newGlobal({newCompartment: true});
g2.eval('function g(){}');

var dbg = new Debugger(g1);
assertEq(dbg.findScripts({global:g1}).length > 0, true);
assertEq(dbg.findScripts({global:g2}).length, 0);
assertEq(dbg.findScripts({global:this}).length, 0);