diff options
Diffstat (limited to 'js/src/jit-test/tests/arguments/rest-debugger.js')
-rw-r--r-- | js/src/jit-test/tests/arguments/rest-debugger.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/arguments/rest-debugger.js b/js/src/jit-test/tests/arguments/rest-debugger.js new file mode 100644 index 0000000000..be9016a07c --- /dev/null +++ b/js/src/jit-test/tests/arguments/rest-debugger.js @@ -0,0 +1,17 @@ +var g = newGlobal({newCompartment: true}); +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({newCompartment: true}); +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); |