Frame-evalWithBindings-15.js (515B)
1 var g = newGlobal({newCompartment: true}); 2 var dbg = new Debugger(g); 3 4 dbg.onDebuggerStatement = function (frame) { 5 // The bindings object is unused but adds another environment on the 6 // environment chain. Make sure 'this' computes the right value in light of 7 // this. 8 assertEq(frame.evalWithBindings(`this === foo;`, { bar: 42 }).return, true); 9 assertEq(frame.evalWithBindings(`eval('this') === foo;`, { bar: 42 }).return, true); 10 }; 11 12 g.eval(` 13 var foo = { bar: function() { debugger; } }; 14 foo.bar(); 15 `);