summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-hoisted-tdz.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-hoisted-tdz.js')
-rw-r--r--js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-hoisted-tdz.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-hoisted-tdz.js b/js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-hoisted-tdz.js
new file mode 100644
index 000000000..e5f9baf44
--- /dev/null
+++ b/js/src/tests/ecma_6/LexicalEnvironment/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);