• 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": 17,
17                  "column": 8
18                },
19                "end": {
20                  "line": 17,
21                  "column": 14
22                }
23              }
24            },
25            "decorators": [],
26            "loc": {
27              "start": {
28                "line": 17,
29                "column": 5
30              },
31              "end": {
32                "line": 17,
33                "column": 6
34              }
35            }
36          },
37          "init": null,
38          "loc": {
39            "start": {
40              "line": 17,
41              "column": 5
42            },
43            "end": {
44              "line": 17,
45              "column": 6
46            }
47          }
48        }
49      ],
50      "kind": "var",
51      "loc": {
52        "start": {
53          "line": 17,
54          "column": 1
55        },
56        "end": {
57          "line": 17,
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": 18,
75                  "column": 8
76                },
77                "end": {
78                  "line": 18,
79                  "column": 14
80                }
81              }
82            },
83            "decorators": [],
84            "loc": {
85              "start": {
86                "line": 18,
87                "column": 5
88              },
89              "end": {
90                "line": 18,
91                "column": 6
92              }
93            }
94          },
95          "init": null,
96          "loc": {
97            "start": {
98              "line": 18,
99              "column": 5
100            },
101            "end": {
102              "line": 18,
103              "column": 6
104            }
105          }
106        }
107      ],
108      "kind": "var",
109      "loc": {
110        "start": {
111          "line": 18,
112          "column": 1
113        },
114        "end": {
115          "line": 18,
116          "column": 15
117        }
118      }
119    },
120    {
121      "type": "VariableDeclaration",
122      "declarations": [
123        {
124          "type": "VariableDeclarator",
125          "id": {
126            "type": "Identifier",
127            "name": "c",
128            "decorators": [],
129            "loc": {
130              "start": {
131                "line": 19,
132                "column": 5
133              },
134              "end": {
135                "line": 19,
136                "column": 6
137              }
138            }
139          },
140          "init": {
141            "type": "ObjectExpression",
142            "properties": [],
143            "loc": {
144              "start": {
145                "line": 19,
146                "column": 9
147              },
148              "end": {
149                "line": 19,
150                "column": 11
151              }
152            }
153          },
154          "loc": {
155            "start": {
156              "line": 19,
157              "column": 5
158            },
159            "end": {
160              "line": 19,
161              "column": 11
162            }
163          }
164        }
165      ],
166      "kind": "var",
167      "loc": {
168        "start": {
169          "line": 19,
170          "column": 1
171        },
172        "end": {
173          "line": 19,
174          "column": 12
175        }
176      }
177    },
178    {
179      "type": "ExpressionStatement",
180      "expression": {
181        "type": "AssignmentExpression",
182        "operator": "=",
183        "left": {
184          "type": "ObjectPattern",
185          "properties": [
186            {
187              "type": "Property",
188              "method": false,
189              "shorthand": false,
190              "computed": false,
191              "key": {
192                "type": "Identifier",
193                "name": "c",
194                "decorators": [],
195                "loc": {
196                  "start": {
197                    "line": 21,
198                    "column": 3
199                  },
200                  "end": {
201                    "line": 21,
202                    "column": 4
203                  }
204                }
205              },
206              "value": {
207                "type": "AssignmentPattern",
208                "left": {
209                  "type": "ObjectPattern",
210                  "properties": [
211                    {
212                      "type": "Property",
213                      "method": false,
214                      "shorthand": true,
215                      "computed": false,
216                      "key": {
217                        "type": "Identifier",
218                        "name": "b",
219                        "decorators": [],
220                        "loc": {
221                          "start": {
222                            "line": 21,
223                            "column": 7
224                          },
225                          "end": {
226                            "line": 21,
227                            "column": 8
228                          }
229                        }
230                      },
231                      "value": {
232                        "type": "Identifier",
233                        "name": "b",
234                        "decorators": [],
235                        "loc": {
236                          "start": {
237                            "line": 21,
238                            "column": 7
239                          },
240                          "end": {
241                            "line": 21,
242                            "column": 8
243                          }
244                        }
245                      },
246                      "kind": "init",
247                      "loc": {
248                        "start": {
249                          "line": 21,
250                          "column": 7
251                        },
252                        "end": {
253                          "line": 21,
254                          "column": 8
255                        }
256                      }
257                    },
258                    {
259                      "type": "Property",
260                      "method": false,
261                      "shorthand": true,
262                      "computed": false,
263                      "key": {
264                        "type": "Identifier",
265                        "name": "a",
266                        "decorators": [],
267                        "loc": {
268                          "start": {
269                            "line": 21,
270                            "column": 10
271                          },
272                          "end": {
273                            "line": 21,
274                            "column": 11
275                          }
276                        }
277                      },
278                      "value": {
279                        "type": "Identifier",
280                        "name": "a",
281                        "decorators": [],
282                        "loc": {
283                          "start": {
284                            "line": 21,
285                            "column": 10
286                          },
287                          "end": {
288                            "line": 21,
289                            "column": 11
290                          }
291                        }
292                      },
293                      "kind": "init",
294                      "loc": {
295                        "start": {
296                          "line": 21,
297                          "column": 10
298                        },
299                        "end": {
300                          "line": 21,
301                          "column": 11
302                        }
303                      }
304                    }
305                  ],
306                  "loc": {
307                    "start": {
308                      "line": 21,
309                      "column": 6
310                    },
311                    "end": {
312                      "line": 21,
313                      "column": 12
314                    }
315                  }
316                },
317                "right": {
318                  "type": "ObjectExpression",
319                  "properties": [
320                    {
321                      "type": "Property",
322                      "method": false,
323                      "shorthand": false,
324                      "computed": false,
325                      "key": {
326                        "type": "Identifier",
327                        "name": "a",
328                        "decorators": [],
329                        "loc": {
330                          "start": {
331                            "line": 21,
332                            "column": 16
333                          },
334                          "end": {
335                            "line": 21,
336                            "column": 17
337                          }
338                        }
339                      },
340                      "value": {
341                        "type": "StringLiteral",
342                        "value": "baz",
343                        "loc": {
344                          "start": {
345                            "line": 21,
346                            "column": 19
347                          },
348                          "end": {
349                            "line": 21,
350                            "column": 24
351                          }
352                        }
353                      },
354                      "kind": "init",
355                      "loc": {
356                        "start": {
357                          "line": 21,
358                          "column": 16
359                        },
360                        "end": {
361                          "line": 21,
362                          "column": 24
363                        }
364                      }
365                    }
366                  ],
367                  "loc": {
368                    "start": {
369                      "line": 21,
370                      "column": 15
371                    },
372                    "end": {
373                      "line": 21,
374                      "column": 25
375                    }
376                  }
377                },
378                "loc": {
379                  "start": {
380                    "line": 21,
381                    "column": 6
382                  },
383                  "end": {
384                    "line": 21,
385                    "column": 25
386                  }
387                }
388              },
389              "kind": "init",
390              "loc": {
391                "start": {
392                  "line": 21,
393                  "column": 3
394                },
395                "end": {
396                  "line": 21,
397                  "column": 25
398                }
399              }
400            }
401          ],
402          "loc": {
403            "start": {
404              "line": 21,
405              "column": 2
406            },
407            "end": {
408              "line": 21,
409              "column": 26
410            }
411          }
412        },
413        "right": {
414          "type": "ObjectExpression",
415          "properties": [
416            {
417              "type": "Property",
418              "method": false,
419              "shorthand": false,
420              "computed": false,
421              "key": {
422                "type": "Identifier",
423                "name": "c",
424                "decorators": [],
425                "loc": {
426                  "start": {
427                    "line": 21,
428                    "column": 30
429                  },
430                  "end": {
431                    "line": 21,
432                    "column": 31
433                  }
434                }
435              },
436              "value": {
437                "type": "ObjectExpression",
438                "properties": [
439                  {
440                    "type": "Property",
441                    "method": false,
442                    "shorthand": false,
443                    "computed": false,
444                    "key": {
445                      "type": "Identifier",
446                      "name": "a",
447                      "decorators": [],
448                      "loc": {
449                        "start": {
450                          "line": 21,
451                          "column": 35
452                        },
453                        "end": {
454                          "line": 21,
455                          "column": 36
456                        }
457                      }
458                    },
459                    "value": {
460                      "type": "NumberLiteral",
461                      "value": 10,
462                      "loc": {
463                        "start": {
464                          "line": 21,
465                          "column": 38
466                        },
467                        "end": {
468                          "line": 21,
469                          "column": 40
470                        }
471                      }
472                    },
473                    "kind": "init",
474                    "loc": {
475                      "start": {
476                        "line": 21,
477                        "column": 35
478                      },
479                      "end": {
480                        "line": 21,
481                        "column": 40
482                      }
483                    }
484                  },
485                  {
486                    "type": "Property",
487                    "method": false,
488                    "shorthand": false,
489                    "computed": false,
490                    "key": {
491                      "type": "Identifier",
492                      "name": "b",
493                      "decorators": [],
494                      "loc": {
495                        "start": {
496                          "line": 21,
497                          "column": 42
498                        },
499                        "end": {
500                          "line": 21,
501                          "column": 43
502                        }
503                      }
504                    },
505                    "value": {
506                      "type": "StringLiteral",
507                      "value": "bar",
508                      "loc": {
509                        "start": {
510                          "line": 21,
511                          "column": 45
512                        },
513                        "end": {
514                          "line": 21,
515                          "column": 50
516                        }
517                      }
518                    },
519                    "kind": "init",
520                    "loc": {
521                      "start": {
522                        "line": 21,
523                        "column": 42
524                      },
525                      "end": {
526                        "line": 21,
527                        "column": 50
528                      }
529                    }
530                  }
531                ],
532                "loc": {
533                  "start": {
534                    "line": 21,
535                    "column": 34
536                  },
537                  "end": {
538                    "line": 21,
539                    "column": 51
540                  }
541                }
542              },
543              "kind": "init",
544              "loc": {
545                "start": {
546                  "line": 21,
547                  "column": 30
548                },
549                "end": {
550                  "line": 21,
551                  "column": 51
552                }
553              }
554            }
555          ],
556          "loc": {
557            "start": {
558              "line": 21,
559              "column": 29
560            },
561            "end": {
562              "line": 21,
563              "column": 52
564            }
565          }
566        },
567        "loc": {
568          "start": {
569            "line": 21,
570            "column": 1
571          },
572          "end": {
573            "line": 21,
574            "column": 53
575          }
576        }
577      },
578      "loc": {
579        "start": {
580          "line": 21,
581          "column": 1
582        },
583        "end": {
584          "line": 21,
585          "column": 54
586        }
587      }
588    }
589  ],
590  "loc": {
591    "start": {
592      "line": 1,
593      "column": 1
594    },
595    "end": {
596      "line": 21,
597      "column": 54
598    }
599  }
600}
601TypeError: Property b does not exist on type { a: number; b: string; } | { a: string; }. [objectDestructuring41.ts:21:6]
602