summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-findObjects-04.js
blob: ac6257563744bac40709b315c94ec88e8c76b537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// findObjects' result includes objects captured by closures.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger();
var gw = dbg.addDebuggee(g);

g.eval(`
  this.f = (function () {
    let a = { foo: () => {} };
    return () => a;
  }());
`);

let objects = dbg.findObjects();
let aw = gw.makeDebuggeeValue(g.f());
assertEq(objects.indexOf(aw) != -1, true);