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