• 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": "NumberLiteral",
31                  "value": 1,
32                  "loc": {
33                    "start": {
34                      "line": 17,
35                      "column": 10
36                    },
37                    "end": {
38                      "line": 17,
39                      "column": 11
40                    }
41                  }
42                },
43                "loc": {
44                  "start": {
45                    "line": 17,
46                    "column": 6
47                  },
48                  "end": {
49                    "line": 17,
50                    "column": 11
51                  }
52                }
53              }
54            ],
55            "loc": {
56              "start": {
57                "line": 17,
58                "column": 5
59              },
60              "end": {
61                "line": 17,
62                "column": 12
63              }
64            }
65          },
66          "init": {
67            "type": "ArrayExpression",
68            "elements": [
69              {
70                "type": "StringLiteral",
71                "value": "foo",
72                "loc": {
73                  "start": {
74                    "line": 17,
75                    "column": 16
76                  },
77                  "end": {
78                    "line": 17,
79                    "column": 21
80                  }
81                }
82              }
83            ],
84            "loc": {
85              "start": {
86                "line": 17,
87                "column": 15
88              },
89              "end": {
90                "line": 17,
91                "column": 22
92              }
93            }
94          },
95          "loc": {
96            "start": {
97              "line": 17,
98              "column": 5
99            },
100            "end": {
101              "line": 17,
102              "column": 22
103            }
104          }
105        }
106      ],
107      "kind": "var",
108      "loc": {
109        "start": {
110          "line": 17,
111          "column": 1
112        },
113        "end": {
114          "line": 17,
115          "column": 23
116        }
117      }
118    },
119    {
120      "type": "ExpressionStatement",
121      "expression": {
122        "type": "AssignmentExpression",
123        "operator": "=",
124        "left": {
125          "type": "Identifier",
126          "name": "a",
127          "decorators": [],
128          "loc": {
129            "start": {
130              "line": 18,
131              "column": 1
132            },
133            "end": {
134              "line": 18,
135              "column": 2
136            }
137          }
138        },
139        "right": {
140          "type": "ObjectExpression",
141          "properties": [],
142          "loc": {
143            "start": {
144              "line": 18,
145              "column": 5
146            },
147            "end": {
148              "line": 18,
149              "column": 7
150            }
151          }
152        },
153        "loc": {
154          "start": {
155            "line": 18,
156            "column": 1
157          },
158          "end": {
159            "line": 18,
160            "column": 7
161          }
162        }
163      },
164      "loc": {
165        "start": {
166          "line": 18,
167          "column": 1
168        },
169        "end": {
170          "line": 18,
171          "column": 8
172        }
173      }
174    }
175  ],
176  "loc": {
177    "start": {
178      "line": 1,
179      "column": 1
180    },
181    "end": {
182      "line": 18,
183      "column": 8
184    }
185  }
186}
187TypeError: Type '{ }' is not assignable to type 'string | number'. [arrayDestructuring3.ts:18:1]
188