summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/generators/iterator-toString.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/generators/iterator-toString.js')
-rw-r--r--js/src/tests/non262/generators/iterator-toString.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/js/src/tests/non262/generators/iterator-toString.js b/js/src/tests/non262/generators/iterator-toString.js
new file mode 100644
index 0000000000..78e4943950
--- /dev/null
+++ b/js/src/tests/non262/generators/iterator-toString.js
@@ -0,0 +1,41 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+//-----------------------------------------------------------------------------
+var summary = "gen.toString() omitting 'yield' from value";
+var actual, expect;
+
+printStatus(summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var failed = false;
+
+function* gen()
+{
+ yield 17;
+}
+
+try
+{
+ var str = gen.toString();
+ var index = str.search(/yield/);
+
+ if (index < 0)
+ throw "yield not found in str: " + str;
+}
+catch (e)
+{
+ failed = e;
+}
+
+
+
+expect = false;
+actual = failed;
+
+reportCompare(expect, actual, summary);