• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "ExpressionStatement",
6      "expression": {
7        "type": "BinaryExpression",
8        "operator": "+",
9        "left": {
10          "type": "Identifier",
11          "name": "a",
12          "decorators": [],
13          "loc": {
14            "start": {
15              "line": 17,
16              "column": 1
17            },
18            "end": {
19              "line": 17,
20              "column": 2
21            }
22          }
23        },
24        "right": {
25          "type": "NumberLiteral",
26          "value": 2,
27          "loc": {
28            "start": {
29              "line": 17,
30              "column": 5
31            },
32            "end": {
33              "line": 17,
34              "column": 6
35            }
36          }
37        },
38        "loc": {
39          "start": {
40            "line": 17,
41            "column": 1
42          },
43          "end": {
44            "line": 17,
45            "column": 6
46          }
47        }
48      },
49      "loc": {
50        "start": {
51          "line": 17,
52          "column": 1
53        },
54        "end": {
55          "line": 17,
56          "column": 7
57        }
58      }
59    },
60    {
61      "type": "VariableDeclaration",
62      "declarations": [
63        {
64          "type": "VariableDeclarator",
65          "id": {
66            "type": "Identifier",
67            "name": "a",
68            "decorators": [],
69            "loc": {
70              "start": {
71                "line": 18,
72                "column": 7
73              },
74              "end": {
75                "line": 18,
76                "column": 8
77              }
78            }
79          },
80          "init": {
81            "type": "NumberLiteral",
82            "value": 6,
83            "loc": {
84              "start": {
85                "line": 18,
86                "column": 11
87              },
88              "end": {
89                "line": 18,
90                "column": 12
91              }
92            }
93          },
94          "loc": {
95            "start": {
96              "line": 18,
97              "column": 7
98            },
99            "end": {
100              "line": 18,
101              "column": 12
102            }
103          }
104        }
105      ],
106      "kind": "const",
107      "loc": {
108        "start": {
109          "line": 18,
110          "column": 1
111        },
112        "end": {
113          "line": 18,
114          "column": 13
115        }
116      }
117    }
118  ],
119  "loc": {
120    "start": {
121      "line": 1,
122      "column": 1
123    },
124    "end": {
125      "line": 18,
126      "column": 13
127    }
128  }
129}
130TypeError: Block-scoped variable 'a' used before its declaration [constUsedBeforeDeclaration.ts:18:7]
131