UNPKG

408 BJavaScriptView Raw
1"use strict";
2
3x; // error (unless disallowUnknownReferences=false)
4if (true) {
5 x; // error
6 if (true) {
7 x; // error
8 }
9 if (true) {
10 let x;
11 x; // ok
12 }
13 let f = function() {
14 return x; // ok
15 };
16 f(); // ok from a static analysis standpoint but runtime error in ES6
17
18 let x = 3;
19
20 f(); // ok
21 x; // ok
22 if (true) {
23 x; // ok
24 }
25}