summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/rest-debugger.js
blob: cdc98624379b4d0a1bba4db7586c1525f36d25e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var g = newGlobal();
g.eval("function f(...x) {}");
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
var fw = gw.getOwnPropertyDescriptor("f").value;
assertEq(fw.parameterNames.toString(), "x");

var g = newGlobal();
g.eval("function f(...rest) { debugger; }");
var dbg = Debugger(g);
dbg.onDebuggerStatement = function (frame) {
    frame.eval("args = arguments");
};
g.f(9, 8, 7);

assertEq(g.args.length, 3);
assertEq(g.args[2], 7);