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