summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/LexicalEnvironment/var-in-catch-body-annex-b-eval-for-of.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/ecma_6/LexicalEnvironment/var-in-catch-body-annex-b-eval-for-of.js')
-rw-r--r--js/src/tests/ecma_6/LexicalEnvironment/var-in-catch-body-annex-b-eval-for-of.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/LexicalEnvironment/var-in-catch-body-annex-b-eval-for-of.js b/js/src/tests/ecma_6/LexicalEnvironment/var-in-catch-body-annex-b-eval-for-of.js
new file mode 100644
index 000000000..901f5c0f7
--- /dev/null
+++ b/js/src/tests/ecma_6/LexicalEnvironment/var-in-catch-body-annex-b-eval-for-of.js
@@ -0,0 +1,12 @@
+// |reftest| skip-if(!xulRuntime.shell)
+
+assertThrowsInstanceOf(() => evaluate(`
+ try { throw null; } catch (e) { eval("for (var e of []) {}") }
+`), SyntaxError);
+
+assertThrowsInstanceOf(new Function(`
+ try { throw null; } catch (e) { eval("for (var e of []) {}") }
+`), SyntaxError);
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);