summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-object-01.js
blob: c8f434bbb179438fa044b18b07d5cd6026ae7399 (plain)
1
2
3
4
5
6
7
8
9
var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);

dbg.onDebuggerStatement = (frame) => {
  assertEq(frame.environment.parent.type, "with");
  assertEq(frame.environment.parent.parent.type, "object");
  assertEq(frame.environment.parent.parent.object.getOwnPropertyDescriptor("x").value, 42);
}
g.evalReturningScope("x = 42; debugger;");