summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/strict-eval-mutation.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/arguments/strict-eval-mutation.js')
-rw-r--r--js/src/jit-test/tests/arguments/strict-eval-mutation.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/arguments/strict-eval-mutation.js b/js/src/jit-test/tests/arguments/strict-eval-mutation.js
new file mode 100644
index 000000000..d33a05c3a
--- /dev/null
+++ b/js/src/jit-test/tests/arguments/strict-eval-mutation.js
@@ -0,0 +1,24 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ */
+load(libdir + 'array-compare.js');
+
+var obj = {};
+
+function strictEvalMutation(code)
+{
+ "use strict";
+ return eval(code);
+}
+
+var a1, a2;
+for (var i = 0; i < 5; i++)
+{
+ a1 = strictEvalMutation("code = 17; arguments");
+ a2 = strictEvalMutation("arguments[0] = 17; arguments");
+ assertEq(strictEvalMutation("arguments[0] = 17; code"), "arguments[0] = 17; code");
+}
+
+assertEq(arraysEqual(a1, ["code = 17; arguments"]), true);
+assertEq(arraysEqual(a2, [17]), true);