summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/rest-debugger.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/arguments/rest-debugger.js')
-rw-r--r--js/src/jit-test/tests/arguments/rest-debugger.js17
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 000000000..cdc986243
--- /dev/null
+++ b/js/src/jit-test/tests/arguments/rest-debugger.js
@@ -0,0 +1,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);