summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/class/checkreturn-for-of-arrow.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/class/checkreturn-for-of-arrow.js')
-rw-r--r--js/src/jit-test/tests/class/checkreturn-for-of-arrow.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/class/checkreturn-for-of-arrow.js b/js/src/jit-test/tests/class/checkreturn-for-of-arrow.js
new file mode 100644
index 0000000000..4358bb1778
--- /dev/null
+++ b/js/src/jit-test/tests/class/checkreturn-for-of-arrow.js
@@ -0,0 +1,29 @@
+var iter = {
+ [Symbol.iterator]() { return this; },
+ next() { return {done: false}; },
+ return() {
+ // Calls |super()|.
+ this.f();
+
+ return {done: true};
+ },
+};
+
+class C extends class {} {
+ constructor() {
+ iter.f = () => super();
+
+ for (var k of iter) {
+ return;
+ }
+ }
+}
+
+function test() {
+ for (var i = 0; i < 100; ++i) {
+ // No error.
+ new C();
+ }
+}
+
+test();