summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/AsyncIterator/prototype/lazy-methods-throw-on-reentry.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/AsyncIterator/prototype/lazy-methods-throw-on-reentry.js')
-rw-r--r--js/src/tests/non262/AsyncIterator/prototype/lazy-methods-throw-on-reentry.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/tests/non262/AsyncIterator/prototype/lazy-methods-throw-on-reentry.js b/js/src/tests/non262/AsyncIterator/prototype/lazy-methods-throw-on-reentry.js
new file mode 100644
index 0000000000..d7a582c6c1
--- /dev/null
+++ b/js/src/tests/non262/AsyncIterator/prototype/lazy-methods-throw-on-reentry.js
@@ -0,0 +1,18 @@
+// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator'))
+
+async function* gen(x) { yield x; }
+
+const methods = ['map', 'filter', 'flatMap'];
+
+for (const method of methods) {
+ const iter = gen('value');
+ const iterHelper = iter[method](x => iterHelper.next());
+ iterHelper.next().then(
+ _ => assertEq(true, false, 'Expected reject.'),
+ err => assertEq(err instanceof TypeError, true),
+ );
+}
+
+if (typeof reportCompare == 'function')
+ reportCompare(0, 0);
+