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