summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Environment-setVariable-04.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Environment-setVariable-04.js')
-rw-r--r--js/src/jit-test/tests/debug/Environment-setVariable-04.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Environment-setVariable-04.js b/js/src/jit-test/tests/debug/Environment-setVariable-04.js
new file mode 100644
index 000000000..9b3b32025
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Environment-setVariable-04.js
@@ -0,0 +1,10 @@
+// setVariable can set variables and arguments in functions.
+
+var g = newGlobal();
+var dbg = new Debugger(g);
+dbg.onDebuggerStatement = function (frame) {
+ frame.environment.setVariable("a", 100);
+ frame.environment.setVariable("b", 200);
+};
+g.eval("function f(a) { var b = a + 1; debugger; return a + b; }");
+assertEq(g.f(1), 300);