• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "FunctionDeclaration",
6      "function": {
7        "type": "ScriptFunction",
8        "id": {
9          "type": "Identifier",
10          "name": "a",
11          "decorators": [],
12          "loc": {
13            "start": {
14              "line": 17,
15              "column": 10
16            },
17            "end": {
18              "line": 17,
19              "column": 11
20            }
21          }
22        },
23        "generator": false,
24        "async": false,
25        "expression": false,
26        "params": [
27          {
28            "type": "Identifier",
29            "name": "a",
30            "typeAnnotation": {
31              "type": "TSArrayType",
32              "elementType": {
33                "type": "TSNumberKeyword",
34                "loc": {
35                  "start": {
36                    "line": 17,
37                    "column": 15
38                  },
39                  "end": {
40                    "line": 17,
41                    "column": 21
42                  }
43                }
44              },
45              "loc": {
46                "start": {
47                  "line": 17,
48                  "column": 15
49                },
50                "end": {
51                  "line": 17,
52                  "column": 23
53                }
54              }
55            },
56            "decorators": [],
57            "loc": {
58              "start": {
59                "line": 17,
60                "column": 12
61              },
62              "end": {
63                "line": 17,
64                "column": 13
65              }
66            }
67          }
68        ],
69        "returnType": {
70          "type": "TSTypeLiteral",
71          "members": [
72            {
73              "type": "TSPropertySignature",
74              "computed": false,
75              "optional": false,
76              "readonly": false,
77              "key": {
78                "type": "Identifier",
79                "name": "b",
80                "decorators": [],
81                "loc": {
82                  "start": {
83                    "line": 17,
84                    "column": 28
85                  },
86                  "end": {
87                    "line": 17,
88                    "column": 29
89                  }
90                }
91              },
92              "typeAnnotation": {
93                "type": "TSNumberKeyword",
94                "loc": {
95                  "start": {
96                    "line": 17,
97                    "column": 31
98                  },
99                  "end": {
100                    "line": 17,
101                    "column": 37
102                  }
103                }
104              },
105              "loc": {
106                "start": {
107                  "line": 17,
108                  "column": 28
109                },
110                "end": {
111                  "line": 17,
112                  "column": 38
113                }
114              }
115            },
116            {
117              "type": "TSPropertySignature",
118              "computed": false,
119              "optional": false,
120              "readonly": false,
121              "key": {
122                "type": "Identifier",
123                "name": "c",
124                "decorators": [],
125                "loc": {
126                  "start": {
127                    "line": 17,
128                    "column": 39
129                  },
130                  "end": {
131                    "line": 17,
132                    "column": 40
133                  }
134                }
135              },
136              "typeAnnotation": {
137                "type": "TSTupleType",
138                "elementTypes": [
139                  {
140                    "type": "TSNumberKeyword",
141                    "loc": {
142                      "start": {
143                        "line": 17,
144                        "column": 43
145                      },
146                      "end": {
147                        "line": 17,
148                        "column": 50
149                      }
150                    }
151                  },
152                  {
153                    "type": "TSStringKeyword",
154                    "loc": {
155                      "start": {
156                        "line": 17,
157                        "column": 51
158                      },
159                      "end": {
160                        "line": 17,
161                        "column": 58
162                      }
163                    }
164                  }
165                ],
166                "loc": {
167                  "start": {
168                    "line": 17,
169                    "column": 42
170                  },
171                  "end": {
172                    "line": 17,
173                    "column": 58
174                  }
175                }
176              },
177              "loc": {
178                "start": {
179                  "line": 17,
180                  "column": 39
181                },
182                "end": {
183                  "line": 17,
184                  "column": 60
185                }
186              }
187            }
188          ],
189          "loc": {
190            "start": {
191              "line": 17,
192              "column": 26
193            },
194            "end": {
195              "line": 17,
196              "column": 60
197            }
198          }
199        },
200        "body": {
201          "type": "BlockStatement",
202          "statements": [
203            {
204              "type": "ReturnStatement",
205              "argument": {
206                "type": "ObjectExpression",
207                "properties": [
208                  {
209                    "type": "Property",
210                    "method": false,
211                    "shorthand": false,
212                    "computed": false,
213                    "key": {
214                      "type": "Identifier",
215                      "name": "b",
216                      "decorators": [],
217                      "loc": {
218                        "start": {
219                          "line": 18,
220                          "column": 14
221                        },
222                        "end": {
223                          "line": 18,
224                          "column": 15
225                        }
226                      }
227                    },
228                    "value": {
229                      "type": "NumberLiteral",
230                      "value": 5,
231                      "loc": {
232                        "start": {
233                          "line": 18,
234                          "column": 17
235                        },
236                        "end": {
237                          "line": 18,
238                          "column": 18
239                        }
240                      }
241                    },
242                    "kind": "init",
243                    "loc": {
244                      "start": {
245                        "line": 18,
246                        "column": 14
247                      },
248                      "end": {
249                        "line": 18,
250                        "column": 18
251                      }
252                    }
253                  },
254                  {
255                    "type": "Property",
256                    "method": false,
257                    "shorthand": false,
258                    "computed": false,
259                    "key": {
260                      "type": "Identifier",
261                      "name": "c",
262                      "decorators": [],
263                      "loc": {
264                        "start": {
265                          "line": 18,
266                          "column": 20
267                        },
268                        "end": {
269                          "line": 18,
270                          "column": 21
271                        }
272                      }
273                    },
274                    "value": {
275                      "type": "ArrayExpression",
276                      "elements": [
277                        {
278                          "type": "NumberLiteral",
279                          "value": 1,
280                          "loc": {
281                            "start": {
282                              "line": 18,
283                              "column": 24
284                            },
285                            "end": {
286                              "line": 18,
287                              "column": 25
288                            }
289                          }
290                        },
291                        {
292                          "type": "StringLiteral",
293                          "value": "foo",
294                          "loc": {
295                            "start": {
296                              "line": 18,
297                              "column": 27
298                            },
299                            "end": {
300                              "line": 18,
301                              "column": 32
302                            }
303                          }
304                        }
305                      ],
306                      "loc": {
307                        "start": {
308                          "line": 18,
309                          "column": 23
310                        },
311                        "end": {
312                          "line": 18,
313                          "column": 33
314                        }
315                      }
316                    },
317                    "kind": "init",
318                    "loc": {
319                      "start": {
320                        "line": 18,
321                        "column": 20
322                      },
323                      "end": {
324                        "line": 18,
325                        "column": 33
326                      }
327                    }
328                  }
329                ],
330                "loc": {
331                  "start": {
332                    "line": 18,
333                    "column": 12
334                  },
335                  "end": {
336                    "line": 18,
337                    "column": 35
338                  }
339                }
340              },
341              "loc": {
342                "start": {
343                  "line": 18,
344                  "column": 5
345                },
346                "end": {
347                  "line": 18,
348                  "column": 36
349                }
350              }
351            }
352          ],
353          "loc": {
354            "start": {
355              "line": 17,
356              "column": 61
357            },
358            "end": {
359              "line": 19,
360              "column": 2
361            }
362          }
363        },
364        "loc": {
365          "start": {
366            "line": 17,
367            "column": 1
368          },
369          "end": {
370            "line": 19,
371            "column": 2
372          }
373        }
374      },
375      "loc": {
376        "start": {
377          "line": 17,
378          "column": 1
379        },
380        "end": {
381          "line": 19,
382          "column": 2
383        }
384      }
385    },
386    {
387      "type": "VariableDeclaration",
388      "declarations": [
389        {
390          "type": "VariableDeclarator",
391          "id": {
392            "type": "ObjectPattern",
393            "properties": [
394              {
395                "type": "Property",
396                "method": false,
397                "shorthand": true,
398                "computed": false,
399                "key": {
400                  "type": "Identifier",
401                  "name": "b",
402                  "decorators": [],
403                  "loc": {
404                    "start": {
405                      "line": 21,
406                      "column": 7
407                    },
408                    "end": {
409                      "line": 21,
410                      "column": 8
411                    }
412                  }
413                },
414                "value": {
415                  "type": "AssignmentPattern",
416                  "left": {
417                    "type": "Identifier",
418                    "name": "b",
419                    "decorators": [],
420                    "loc": {
421                      "start": {
422                        "line": 21,
423                        "column": 7
424                      },
425                      "end": {
426                        "line": 21,
427                        "column": 8
428                      }
429                    }
430                  },
431                  "right": {
432                    "type": "StringLiteral",
433                    "value": "foo",
434                    "loc": {
435                      "start": {
436                        "line": 21,
437                        "column": 11
438                      },
439                      "end": {
440                        "line": 21,
441                        "column": 16
442                      }
443                    }
444                  },
445                  "loc": {
446                    "start": {
447                      "line": 21,
448                      "column": 7
449                    },
450                    "end": {
451                      "line": 21,
452                      "column": 16
453                    }
454                  }
455                },
456                "kind": "init",
457                "loc": {
458                  "start": {
459                    "line": 21,
460                    "column": 7
461                  },
462                  "end": {
463                    "line": 21,
464                    "column": 16
465                  }
466                }
467              },
468              {
469                "type": "Property",
470                "method": false,
471                "shorthand": false,
472                "computed": false,
473                "key": {
474                  "type": "Identifier",
475                  "name": "c",
476                  "decorators": [],
477                  "loc": {
478                    "start": {
479                      "line": 21,
480                      "column": 18
481                    },
482                    "end": {
483                      "line": 21,
484                      "column": 19
485                    }
486                  }
487                },
488                "value": {
489                  "type": "ArrayPattern",
490                  "elements": [
491                    {
492                      "type": "Identifier",
493                      "name": "c",
494                      "decorators": [],
495                      "loc": {
496                        "start": {
497                          "line": 21,
498                          "column": 22
499                        },
500                        "end": {
501                          "line": 21,
502                          "column": 23
503                        }
504                      }
505                    },
506                    {
507                      "type": "Identifier",
508                      "name": "d",
509                      "decorators": [],
510                      "loc": {
511                        "start": {
512                          "line": 21,
513                          "column": 25
514                        },
515                        "end": {
516                          "line": 21,
517                          "column": 26
518                        }
519                      }
520                    }
521                  ],
522                  "loc": {
523                    "start": {
524                      "line": 21,
525                      "column": 21
526                    },
527                    "end": {
528                      "line": 21,
529                      "column": 27
530                    }
531                  }
532                },
533                "kind": "init",
534                "loc": {
535                  "start": {
536                    "line": 21,
537                    "column": 18
538                  },
539                  "end": {
540                    "line": 21,
541                    "column": 27
542                  }
543                }
544              }
545            ],
546            "loc": {
547              "start": {
548                "line": 21,
549                "column": 5
550              },
551              "end": {
552                "line": 21,
553                "column": 29
554              }
555            }
556          },
557          "init": {
558            "type": "CallExpression",
559            "callee": {
560              "type": "Identifier",
561              "name": "a",
562              "decorators": [],
563              "loc": {
564                "start": {
565                  "line": 21,
566                  "column": 32
567                },
568                "end": {
569                  "line": 21,
570                  "column": 33
571                }
572              }
573            },
574            "arguments": [
575              {
576                "type": "ArrayExpression",
577                "elements": [
578                  {
579                    "type": "NumberLiteral",
580                    "value": 1,
581                    "loc": {
582                      "start": {
583                        "line": 21,
584                        "column": 35
585                      },
586                      "end": {
587                        "line": 21,
588                        "column": 36
589                      }
590                    }
591                  },
592                  {
593                    "type": "NumberLiteral",
594                    "value": 2,
595                    "loc": {
596                      "start": {
597                        "line": 21,
598                        "column": 38
599                      },
600                      "end": {
601                        "line": 21,
602                        "column": 39
603                      }
604                    }
605                  },
606                  {
607                    "type": "NumberLiteral",
608                    "value": 3,
609                    "loc": {
610                      "start": {
611                        "line": 21,
612                        "column": 41
613                      },
614                      "end": {
615                        "line": 21,
616                        "column": 42
617                      }
618                    }
619                  }
620                ],
621                "loc": {
622                  "start": {
623                    "line": 21,
624                    "column": 34
625                  },
626                  "end": {
627                    "line": 21,
628                    "column": 43
629                  }
630                }
631              }
632            ],
633            "optional": false,
634            "loc": {
635              "start": {
636                "line": 21,
637                "column": 32
638              },
639              "end": {
640                "line": 21,
641                "column": 44
642              }
643            }
644          },
645          "loc": {
646            "start": {
647              "line": 21,
648              "column": 5
649            },
650            "end": {
651              "line": 21,
652              "column": 44
653            }
654          }
655        }
656      ],
657      "kind": "var",
658      "loc": {
659        "start": {
660          "line": 21,
661          "column": 1
662        },
663        "end": {
664          "line": 21,
665          "column": 45
666        }
667      }
668    },
669    {
670      "type": "ExpressionStatement",
671      "expression": {
672        "type": "AssignmentExpression",
673        "operator": "=",
674        "left": {
675          "type": "Identifier",
676          "name": "d",
677          "decorators": [],
678          "loc": {
679            "start": {
680              "line": 22,
681              "column": 1
682            },
683            "end": {
684              "line": 22,
685              "column": 2
686            }
687          }
688        },
689        "right": {
690          "type": "ObjectExpression",
691          "properties": [],
692          "loc": {
693            "start": {
694              "line": 22,
695              "column": 5
696            },
697            "end": {
698              "line": 22,
699              "column": 7
700            }
701          }
702        },
703        "loc": {
704          "start": {
705            "line": 22,
706            "column": 1
707          },
708          "end": {
709            "line": 22,
710            "column": 7
711          }
712        }
713      },
714      "loc": {
715        "start": {
716          "line": 22,
717          "column": 1
718        },
719        "end": {
720          "line": 22,
721          "column": 8
722        }
723      }
724    }
725  ],
726  "loc": {
727    "start": {
728      "line": 1,
729      "column": 1
730    },
731    "end": {
732      "line": 22,
733      "column": 8
734    }
735  }
736}
737TypeError: Type '{ }' is not assignable to type 'string'. [objectDestructuring25.ts:22:1]
738