• 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": "ObjectPattern",
11            "properties": [
12              {
13                "type": "Property",
14                "method": false,
15                "shorthand": true,
16                "computed": false,
17                "key": {
18                  "type": "Identifier",
19                  "name": "a",
20                  "decorators": [],
21                  "loc": {
22                    "start": {
23                      "line": 17,
24                      "column": 7
25                    },
26                    "end": {
27                      "line": 17,
28                      "column": 8
29                    }
30                  }
31                },
32                "value": {
33                  "type": "AssignmentPattern",
34                  "left": {
35                    "type": "Identifier",
36                    "name": "a",
37                    "decorators": [],
38                    "loc": {
39                      "start": {
40                        "line": 17,
41                        "column": 7
42                      },
43                      "end": {
44                        "line": 17,
45                        "column": 8
46                      }
47                    }
48                  },
49                  "right": {
50                    "type": "NumberLiteral",
51                    "value": 5,
52                    "loc": {
53                      "start": {
54                        "line": 17,
55                        "column": 11
56                      },
57                      "end": {
58                        "line": 17,
59                        "column": 12
60                      }
61                    }
62                  },
63                  "loc": {
64                    "start": {
65                      "line": 17,
66                      "column": 7
67                    },
68                    "end": {
69                      "line": 17,
70                      "column": 12
71                    }
72                  }
73                },
74                "kind": "init",
75                "loc": {
76                  "start": {
77                    "line": 17,
78                    "column": 7
79                  },
80                  "end": {
81                    "line": 17,
82                    "column": 12
83                  }
84                }
85              },
86              {
87                "type": "Property",
88                "method": false,
89                "shorthand": false,
90                "computed": false,
91                "key": {
92                  "type": "Identifier",
93                  "name": "b",
94                  "decorators": [],
95                  "loc": {
96                    "start": {
97                      "line": 17,
98                      "column": 14
99                    },
100                    "end": {
101                      "line": 17,
102                      "column": 15
103                    }
104                  }
105                },
106                "value": {
107                  "type": "Identifier",
108                  "name": "foo",
109                  "decorators": [],
110                  "loc": {
111                    "start": {
112                      "line": 17,
113                      "column": 17
114                    },
115                    "end": {
116                      "line": 17,
117                      "column": 20
118                    }
119                  }
120                },
121                "kind": "init",
122                "loc": {
123                  "start": {
124                    "line": 17,
125                    "column": 14
126                  },
127                  "end": {
128                    "line": 17,
129                    "column": 20
130                  }
131                }
132              }
133            ],
134            "loc": {
135              "start": {
136                "line": 17,
137                "column": 5
138              },
139              "end": {
140                "line": 17,
141                "column": 22
142              }
143            }
144          },
145          "init": {
146            "type": "ObjectExpression",
147            "properties": [
148              {
149                "type": "Property",
150                "method": false,
151                "shorthand": false,
152                "computed": false,
153                "key": {
154                  "type": "Identifier",
155                  "name": "foo",
156                  "decorators": [],
157                  "loc": {
158                    "start": {
159                      "line": 17,
160                      "column": 27
161                    },
162                    "end": {
163                      "line": 17,
164                      "column": 30
165                    }
166                  }
167                },
168                "value": {
169                  "type": "NumberLiteral",
170                  "value": 5,
171                  "loc": {
172                    "start": {
173                      "line": 17,
174                      "column": 32
175                    },
176                    "end": {
177                      "line": 17,
178                      "column": 33
179                    }
180                  }
181                },
182                "kind": "init",
183                "loc": {
184                  "start": {
185                    "line": 17,
186                    "column": 27
187                  },
188                  "end": {
189                    "line": 17,
190                    "column": 33
191                  }
192                }
193              }
194            ],
195            "loc": {
196              "start": {
197                "line": 17,
198                "column": 25
199              },
200              "end": {
201                "line": 17,
202                "column": 35
203              }
204            }
205          },
206          "loc": {
207            "start": {
208              "line": 17,
209              "column": 5
210            },
211            "end": {
212              "line": 17,
213              "column": 35
214            }
215          }
216        }
217      ],
218      "kind": "var",
219      "loc": {
220        "start": {
221          "line": 17,
222          "column": 1
223        },
224        "end": {
225          "line": 17,
226          "column": 36
227        }
228      }
229    }
230  ],
231  "loc": {
232    "start": {
233      "line": 1,
234      "column": 1
235    },
236    "end": {
237      "line": 17,
238      "column": 36
239    }
240  }
241}
242TypeError: Object literal may only specify known properties, and property 'foo' does not exist in the pattern. [objectDestructuring3.ts:17:5]
243