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