summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/strict-args-generator-flushstack.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/arguments/strict-args-generator-flushstack.js')
-rw-r--r--js/src/jit-test/tests/arguments/strict-args-generator-flushstack.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/arguments/strict-args-generator-flushstack.js b/js/src/jit-test/tests/arguments/strict-args-generator-flushstack.js
new file mode 100644
index 000000000..8370f4602
--- /dev/null
+++ b/js/src/jit-test/tests/arguments/strict-args-generator-flushstack.js
@@ -0,0 +1,27 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ */
+var args;
+
+function upToTen()
+{
+ "use strict";
+ eval("args = arguments;");
+ for (var i = 0; i < 9; i++)
+ yield i;
+}
+
+var gen = upToTen();
+
+var i = 0;
+for (var v in gen)
+{
+ assertEq(v, i);
+ i++;
+}
+
+assertEq(i, 9);
+
+assertEq(Object.prototype.toString.call(args), "[object Arguments]");
+assertEq(args.length, 0);