summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-eval-12.js
blob: 498e7a07a23885ffa673e6510a7488f5750bd066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// The arguments can escape from a function via a debugging hook.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);

// capture arguments object and test function
dbg.onDebuggerStatement = function (frame) {
  var args = frame.older.environment.parent.getVariable('arguments');
  assertEq(args.missingArguments, true);
};
g.eval("function h() { debugger; }");
g.eval("function f() { var x = 0; return function() { x++; h() } }");
g.eval("f('ponies')()");