summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/lexical-environment/block-scoped-functions-hoisted-tdz.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/lexical-environment/block-scoped-functions-hoisted-tdz.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/non262/lexical-environment/block-scoped-functions-hoisted-tdz.js b/js/src/tests/non262/lexical-environment/block-scoped-functions-hoisted-tdz.js
new file mode 100644
index 0000000000..e5f9baf446
--- /dev/null
+++ b/js/src/tests/non262/lexical-environment/block-scoped-functions-hoisted-tdz.js
@@ -0,0 +1,30 @@
+var log = "";
+try {
+ (function() {
+ {
+ let y = f();
+ function f() { y; }
+ }
+ })()
+} catch (e) {
+ log += e instanceof ReferenceError;
+}
+
+try {
+ function f() {
+ switch (1) {
+ case 0:
+ let x;
+ case 1:
+ (function() { x; })();
+ }
+ }
+ f();
+} catch (e) {
+ log += e instanceof ReferenceError;
+}
+
+assertEq(log, "truetrue");
+
+if ("reportCompare" in this)
+ reportCompare(true, true);