summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-findObjects-04.js
blob: a01378e35fa65ab5297ff1b121dc10de5e507c68 (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();
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);