• 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": "ArrayPattern",
11            "elements": [
12              {
13                "type": "RestElement",
14                "argument": {
15                  "type": "ArrayPattern",
16                  "elements": [
17                    {
18                      "type": "AssignmentPattern",
19                      "left": {
20                        "type": "Identifier",
21                        "name": "b",
22                        "decorators": [],
23                        "loc": {
24                          "start": {
25                            "line": 17,
26                            "column": 10
27                          },
28                          "end": {
29                            "line": 17,
30                            "column": 11
31                          }
32                        }
33                      },
34                      "right": {
35                        "type": "NumberLiteral",
36                        "value": 6,
37                        "loc": {
38                          "start": {
39                            "line": 17,
40                            "column": 14
41                          },
42                          "end": {
43                            "line": 17,
44                            "column": 15
45                          }
46                        }
47                      },
48                      "loc": {
49                        "start": {
50                          "line": 17,
51                          "column": 10
52                        },
53                        "end": {
54                          "line": 17,
55                          "column": 15
56                        }
57                      }
58                    },
59                    {
60                      "type": "AssignmentPattern",
61                      "left": {
62                        "type": "Identifier",
63                        "name": "c",
64                        "decorators": [],
65                        "loc": {
66                          "start": {
67                            "line": 17,
68                            "column": 17
69                          },
70                          "end": {
71                            "line": 17,
72                            "column": 18
73                          }
74                        }
75                      },
76                      "right": {
77                        "type": "StringLiteral",
78                        "value": "foo",
79                        "loc": {
80                          "start": {
81                            "line": 17,
82                            "column": 21
83                          },
84                          "end": {
85                            "line": 17,
86                            "column": 26
87                          }
88                        }
89                      },
90                      "loc": {
91                        "start": {
92                          "line": 17,
93                          "column": 17
94                        },
95                        "end": {
96                          "line": 17,
97                          "column": 26
98                        }
99                      }
100                    },
101                    {
102                      "type": "Identifier",
103                      "name": "d",
104                      "decorators": [],
105                      "loc": {
106                        "start": {
107                          "line": 17,
108                          "column": 28
109                        },
110                        "end": {
111                          "line": 17,
112                          "column": 29
113                        }
114                      }
115                    }
116                  ],
117                  "loc": {
118                    "start": {
119                      "line": 17,
120                      "column": 9
121                    },
122                    "end": {
123                      "line": 17,
124                      "column": 30
125                    }
126                  }
127                },
128                "loc": {
129                  "start": {
130                    "line": 17,
131                    "column": 6
132                  },
133                  "end": {
134                    "line": 17,
135                    "column": 30
136                  }
137                }
138              }
139            ],
140            "typeAnnotation": {
141              "type": "TSTupleType",
142              "elementTypes": [
143                {
144                  "type": "TSNumberKeyword",
145                  "loc": {
146                    "start": {
147                      "line": 17,
148                      "column": 34
149                    },
150                    "end": {
151                      "line": 17,
152                      "column": 41
153                    }
154                  }
155                },
156                {
157                  "type": "TSUnionType",
158                  "types": [
159                    {
160                      "type": "TSNumberKeyword",
161                      "loc": {
162                        "start": {
163                          "line": 17,
164                          "column": 42
165                        },
166                        "end": {
167                          "line": 17,
168                          "column": 48
169                        }
170                      }
171                    },
172                    {
173                      "type": "TSStringKeyword",
174                      "loc": {
175                        "start": {
176                          "line": 17,
177                          "column": 51
178                        },
179                        "end": {
180                          "line": 17,
181                          "column": 57
182                        }
183                      }
184                    }
185                  ],
186                  "loc": {
187                    "start": {
188                      "line": 17,
189                      "column": 42
190                    },
191                    "end": {
192                      "line": 17,
193                      "column": 58
194                    }
195                  }
196                }
197              ],
198              "loc": {
199                "start": {
200                  "line": 17,
201                  "column": 33
202                },
203                "end": {
204                  "line": 17,
205                  "column": 58
206                }
207              }
208            },
209            "loc": {
210              "start": {
211                "line": 17,
212                "column": 5
213              },
214              "end": {
215                "line": 17,
216                "column": 31
217              }
218            }
219          },
220          "init": {
221            "type": "ArrayExpression",
222            "elements": [
223              {
224                "type": "NumberLiteral",
225                "value": 1,
226                "loc": {
227                  "start": {
228                    "line": 17,
229                    "column": 62
230                  },
231                  "end": {
232                    "line": 17,
233                    "column": 63
234                  }
235                }
236              },
237              {
238                "type": "NumberLiteral",
239                "value": 2,
240                "loc": {
241                  "start": {
242                    "line": 17,
243                    "column": 65
244                  },
245                  "end": {
246                    "line": 17,
247                    "column": 66
248                  }
249                }
250              }
251            ],
252            "loc": {
253              "start": {
254                "line": 17,
255                "column": 61
256              },
257              "end": {
258                "line": 17,
259                "column": 67
260              }
261            }
262          },
263          "loc": {
264            "start": {
265              "line": 17,
266              "column": 5
267            },
268            "end": {
269              "line": 17,
270              "column": 67
271            }
272          }
273        }
274      ],
275      "kind": "var",
276      "loc": {
277        "start": {
278          "line": 17,
279          "column": 1
280        },
281        "end": {
282          "line": 17,
283          "column": 68
284        }
285      }
286    }
287  ],
288  "loc": {
289    "start": {
290      "line": 1,
291      "column": 1
292    },
293    "end": {
294      "line": 17,
295      "column": 68
296    }
297  }
298}
299TypeError: Tuple type [number, number | string] of length 2 has no element at index 2. [arrayDestructuring27.ts:17:9]
300