• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "TSInterfaceDeclaration",
6      "body": {
7        "type": "TSInterfaceBody",
8        "body": [
9          {
10            "type": "TSIndexSignature",
11            "parameters": {
12              "type": "Identifier",
13              "name": "a",
14              "typeAnnotation": {
15                "type": "TSNumberKeyword",
16                "loc": {
17                  "start": {
18                    "line": 17,
19                    "column": 28
20                  },
21                  "end": {
22                    "line": 17,
23                    "column": 34
24                  }
25                }
26              },
27              "decorators": [],
28              "loc": {
29                "start": {
30                  "line": 17,
31                  "column": 26
32                },
33                "end": {
34                  "line": 17,
35                  "column": 27
36                }
37              }
38            },
39            "typeAnnotation": {
40              "type": "TSNumberKeyword",
41              "loc": {
42                "start": {
43                  "line": 17,
44                  "column": 36
45                },
46                "end": {
47                  "line": 17,
48                  "column": 42
49                }
50              }
51            },
52            "readonly": true,
53            "loc": {
54              "start": {
55                "line": 17,
56                "column": 16
57              },
58              "end": {
59                "line": 17,
60                "column": 43
61              }
62            }
63          },
64          {
65            "type": "TSIndexSignature",
66            "parameters": {
67              "type": "Identifier",
68              "name": "b",
69              "typeAnnotation": {
70                "type": "TSStringKeyword",
71                "loc": {
72                  "start": {
73                    "line": 18,
74                    "column": 19
75                  },
76                  "end": {
77                    "line": 18,
78                    "column": 25
79                  }
80                }
81              },
82              "decorators": [],
83              "loc": {
84                "start": {
85                  "line": 18,
86                  "column": 17
87                },
88                "end": {
89                  "line": 18,
90                  "column": 18
91                }
92              }
93            },
94            "typeAnnotation": {
95              "type": "TSNumberKeyword",
96              "loc": {
97                "start": {
98                  "line": 18,
99                  "column": 27
100                },
101                "end": {
102                  "line": 18,
103                  "column": 33
104                }
105              }
106            },
107            "readonly": false,
108            "loc": {
109              "start": {
110                "line": 18,
111                "column": 16
112              },
113              "end": {
114                "line": 18,
115                "column": 34
116              }
117            }
118          }
119        ],
120        "loc": {
121          "start": {
122            "line": 17,
123            "column": 15
124          },
125          "end": {
126            "line": 18,
127            "column": 35
128          }
129        }
130      },
131      "id": {
132        "type": "Identifier",
133        "name": "foo",
134        "decorators": [],
135        "loc": {
136          "start": {
137            "line": 17,
138            "column": 11
139          },
140          "end": {
141            "line": 17,
142            "column": 14
143          }
144        }
145      },
146      "extends": [],
147      "loc": {
148        "start": {
149          "line": 17,
150          "column": 1
151        },
152        "end": {
153          "line": 18,
154          "column": 35
155        }
156      }
157    },
158    {
159      "type": "VariableDeclaration",
160      "declarations": [
161        {
162          "type": "VariableDeclarator",
163          "id": {
164            "type": "Identifier",
165            "name": "a",
166            "typeAnnotation": {
167              "type": "TSTypeReference",
168              "typeName": {
169                "type": "Identifier",
170                "name": "foo",
171                "decorators": [],
172                "loc": {
173                  "start": {
174                    "line": 20,
175                    "column": 8
176                  },
177                  "end": {
178                    "line": 20,
179                    "column": 11
180                  }
181                }
182              },
183              "loc": {
184                "start": {
185                  "line": 20,
186                  "column": 8
187                },
188                "end": {
189                  "line": 20,
190                  "column": 11
191                }
192              }
193            },
194            "decorators": [],
195            "loc": {
196              "start": {
197                "line": 20,
198                "column": 5
199              },
200              "end": {
201                "line": 20,
202                "column": 6
203              }
204            }
205          },
206          "init": null,
207          "loc": {
208            "start": {
209              "line": 20,
210              "column": 5
211            },
212            "end": {
213              "line": 20,
214              "column": 6
215            }
216          }
217        }
218      ],
219      "kind": "var",
220      "loc": {
221        "start": {
222          "line": 20,
223          "column": 1
224        },
225        "end": {
226          "line": 20,
227          "column": 12
228        }
229      }
230    },
231    {
232      "type": "ExpressionStatement",
233      "expression": {
234        "type": "AssignmentExpression",
235        "operator": "=",
236        "left": {
237          "type": "MemberExpression",
238          "object": {
239            "type": "Identifier",
240            "name": "a",
241            "decorators": [],
242            "loc": {
243              "start": {
244                "line": 21,
245                "column": 1
246              },
247              "end": {
248                "line": 21,
249                "column": 2
250              }
251            }
252          },
253          "property": {
254            "type": "NumberLiteral",
255            "value": 5,
256            "loc": {
257              "start": {
258                "line": 21,
259                "column": 3
260              },
261              "end": {
262                "line": 21,
263                "column": 4
264              }
265            }
266          },
267          "computed": true,
268          "optional": false,
269          "loc": {
270            "start": {
271              "line": 21,
272              "column": 1
273            },
274            "end": {
275              "line": 21,
276              "column": 5
277            }
278          }
279        },
280        "right": {
281          "type": "NumberLiteral",
282          "value": 5,
283          "loc": {
284            "start": {
285              "line": 21,
286              "column": 8
287            },
288            "end": {
289              "line": 21,
290              "column": 9
291            }
292          }
293        },
294        "loc": {
295          "start": {
296            "line": 21,
297            "column": 1
298          },
299          "end": {
300            "line": 21,
301            "column": 9
302          }
303        }
304      },
305      "loc": {
306        "start": {
307          "line": 21,
308          "column": 1
309        },
310        "end": {
311          "line": 21,
312          "column": 10
313        }
314      }
315    }
316  ],
317  "loc": {
318    "start": {
319      "line": 1,
320      "column": 1
321    },
322    "end": {
323      "line": 22,
324      "column": 1
325    }
326  }
327}
328TypeError: Cannot assign to this property because it is readonly. [member_expression_72.ts:21:1]
329