summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-evalWithBindings-15.js
blob: 319eaaeb39bf7cc200896c38069d86f110281744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var g = newGlobal();
var dbg = new Debugger(g);

dbg.onDebuggerStatement = function (frame) {
  // The bindings object is unused but adds another environment on the
  // environment chain. Make sure 'this' computes the right value in light of
  // this.
  assertEq(frame.evalWithBindings(`this === foo;`, { bar: 42 }).return, true);
  assertEq(frame.evalWithBindings(`eval('this') === foo;`, { bar: 42 }).return, true);
};

g.eval(`
var foo = { bar: function() { debugger; } };
foo.bar();
`);