blob: 98aba48d142e0ba6d9a2c114c0f82e449fc99e3c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
var g = newGlobal({newCompartment: true});
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();
`);
|