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