• 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": "ObjectPattern",
11            "properties": [
12              {
13                "type": "Property",
14                "method": false,
15                "shorthand": false,
16                "computed": false,
17                "key": {
18                  "type": "Identifier",
19                  "name": "a",
20                  "decorators": [],
21                  "loc": {
22                    "start": {
23                      "line": 17,
24                      "column": 7
25                    },
26                    "end": {
27                      "line": 17,
28                      "column": 8
29                    }
30                  }
31                },
32                "value": {
33                  "type": "Identifier",
34                  "name": "foo",
35                  "decorators": [],
36                  "loc": {
37                    "start": {
38                      "line": 17,
39                      "column": 10
40                    },
41                    "end": {
42                      "line": 17,
43                      "column": 13
44                    }
45                  }
46                },
47                "kind": "init",
48                "loc": {
49                  "start": {
50                    "line": 17,
51                    "column": 7
52                  },
53                  "end": {
54                    "line": 17,
55                    "column": 13
56                  }
57                }
58              }
59            ],
60            "loc": {
61              "start": {
62                "line": 17,
63                "column": 5
64              },
65              "end": {
66                "line": 17,
67                "column": 15
68              }
69            }
70          },
71          "init": {
72            "type": "ObjectExpression",
73            "properties": [
74              {
75                "type": "Property",
76                "method": false,
77                "shorthand": false,
78                "computed": false,
79                "key": {
80                  "type": "Identifier",
81                  "name": "a",
82                  "decorators": [],
83                  "loc": {
84                    "start": {
85                      "line": 17,
86                      "column": 20
87                    },
88                    "end": {
89                      "line": 17,
90                      "column": 21
91                    }
92                  }
93                },
94                "value": {
95                  "type": "ObjectExpression",
96                  "properties": [
97                    {
98                      "type": "Property",
99                      "method": false,
100                      "shorthand": false,
101                      "computed": false,
102                      "key": {
103                        "type": "Identifier",
104                        "name": "a",
105                        "decorators": [],
106                        "loc": {
107                          "start": {
108                            "line": 17,
109                            "column": 25
110                          },
111                          "end": {
112                            "line": 17,
113                            "column": 26
114                          }
115                        }
116                      },
117                      "value": {
118                        "type": "NumberLiteral",
119                        "value": 1,
120                        "loc": {
121                          "start": {
122                            "line": 17,
123                            "column": 28
124                          },
125                          "end": {
126                            "line": 17,
127                            "column": 29
128                          }
129                        }
130                      },
131                      "kind": "init",
132                      "loc": {
133                        "start": {
134                          "line": 17,
135                          "column": 25
136                        },
137                        "end": {
138                          "line": 17,
139                          "column": 29
140                        }
141                      }
142                    },
143                    {
144                      "type": "Property",
145                      "method": false,
146                      "shorthand": false,
147                      "computed": false,
148                      "key": {
149                        "type": "Identifier",
150                        "name": "b",
151                        "decorators": [],
152                        "loc": {
153                          "start": {
154                            "line": 17,
155                            "column": 31
156                          },
157                          "end": {
158                            "line": 17,
159                            "column": 32
160                          }
161                        }
162                      },
163                      "value": {
164                        "type": "BooleanLiteral",
165                        "value": true,
166                        "loc": {
167                          "start": {
168                            "line": 17,
169                            "column": 34
170                          },
171                          "end": {
172                            "line": 17,
173                            "column": 38
174                          }
175                        }
176                      },
177                      "kind": "init",
178                      "loc": {
179                        "start": {
180                          "line": 17,
181                          "column": 31
182                        },
183                        "end": {
184                          "line": 17,
185                          "column": 38
186                        }
187                      }
188                    }
189                  ],
190                  "loc": {
191                    "start": {
192                      "line": 17,
193                      "column": 23
194                    },
195                    "end": {
196                      "line": 17,
197                      "column": 40
198                    }
199                  }
200                },
201                "kind": "init",
202                "loc": {
203                  "start": {
204                    "line": 17,
205                    "column": 20
206                  },
207                  "end": {
208                    "line": 17,
209                    "column": 40
210                  }
211                }
212              }
213            ],
214            "loc": {
215              "start": {
216                "line": 17,
217                "column": 18
218              },
219              "end": {
220                "line": 17,
221                "column": 42
222              }
223            }
224          },
225          "loc": {
226            "start": {
227              "line": 17,
228              "column": 5
229            },
230            "end": {
231              "line": 17,
232              "column": 42
233            }
234          }
235        }
236      ],
237      "kind": "var",
238      "loc": {
239        "start": {
240          "line": 17,
241          "column": 1
242        },
243        "end": {
244          "line": 17,
245          "column": 43
246        }
247      }
248    },
249    {
250      "type": "ExpressionStatement",
251      "expression": {
252        "type": "AssignmentExpression",
253        "operator": "=",
254        "left": {
255          "type": "Identifier",
256          "name": "foo",
257          "decorators": [],
258          "loc": {
259            "start": {
260              "line": 18,
261              "column": 1
262            },
263            "end": {
264              "line": 18,
265              "column": 4
266            }
267          }
268        },
269        "right": {
270          "type": "ObjectExpression",
271          "properties": [
272            {
273              "type": "Property",
274              "method": false,
275              "shorthand": false,
276              "computed": false,
277              "key": {
278                "type": "Identifier",
279                "name": "a",
280                "decorators": [],
281                "loc": {
282                  "start": {
283                    "line": 18,
284                    "column": 9
285                  },
286                  "end": {
287                    "line": 18,
288                    "column": 10
289                  }
290                }
291              },
292              "value": {
293                "type": "StringLiteral",
294                "value": "foo",
295                "loc": {
296                  "start": {
297                    "line": 18,
298                    "column": 12
299                  },
300                  "end": {
301                    "line": 18,
302                    "column": 17
303                  }
304                }
305              },
306              "kind": "init",
307              "loc": {
308                "start": {
309                  "line": 18,
310                  "column": 9
311                },
312                "end": {
313                  "line": 18,
314                  "column": 17
315                }
316              }
317            },
318            {
319              "type": "Property",
320              "method": false,
321              "shorthand": false,
322              "computed": false,
323              "key": {
324                "type": "Identifier",
325                "name": "b",
326                "decorators": [],
327                "loc": {
328                  "start": {
329                    "line": 18,
330                    "column": 19
331                  },
332                  "end": {
333                    "line": 18,
334                    "column": 20
335                  }
336                }
337              },
338              "value": {
339                "type": "BooleanLiteral",
340                "value": false,
341                "loc": {
342                  "start": {
343                    "line": 18,
344                    "column": 22
345                  },
346                  "end": {
347                    "line": 18,
348                    "column": 27
349                  }
350                }
351              },
352              "kind": "init",
353              "loc": {
354                "start": {
355                  "line": 18,
356                  "column": 19
357                },
358                "end": {
359                  "line": 18,
360                  "column": 27
361                }
362              }
363            }
364          ],
365          "loc": {
366            "start": {
367              "line": 18,
368              "column": 7
369            },
370            "end": {
371              "line": 18,
372              "column": 29
373            }
374          }
375        },
376        "loc": {
377          "start": {
378            "line": 18,
379            "column": 1
380          },
381          "end": {
382            "line": 18,
383            "column": 29
384          }
385        }
386      },
387      "loc": {
388        "start": {
389          "line": 18,
390          "column": 1
391        },
392        "end": {
393          "line": 18,
394          "column": 30
395        }
396      }
397    }
398  ],
399  "loc": {
400    "start": {
401      "line": 1,
402      "column": 1
403    },
404    "end": {
405      "line": 18,
406      "column": 30
407    }
408  }
409}
410TypeError: Type 'string' is not assignable to type 'number'. [objectDestructuring6.ts:18:9]
411