Skip to content

Commit 99f9a10

Browse files
Mark RestElement as assignable
1 parent 05bf6d3 commit 99f9a10

3 files changed

Lines changed: 63 additions & 0 deletions

File tree

packages/babel-parser/src/parser/lval.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default class LValParser extends NodeUtils {
6868
case "ObjectPattern":
6969
case "ArrayPattern":
7070
case "AssignmentPattern":
71+
case "RestElement":
7172
return true;
7273

7374
case "ObjectExpression": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const f = (...args): void => {};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"type": "File",
3+
"start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}},
4+
"program": {
5+
"type": "Program",
6+
"start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}},
7+
"sourceType": "module",
8+
"interpreter": null,
9+
"body": [
10+
{
11+
"type": "VariableDeclaration",
12+
"start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}},
13+
"declarations": [
14+
{
15+
"type": "VariableDeclarator",
16+
"start":6,"end":31,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":31}},
17+
"id": {
18+
"type": "Identifier",
19+
"start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"},
20+
"name": "f"
21+
},
22+
"init": {
23+
"type": "ArrowFunctionExpression",
24+
"start":10,"end":31,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":31}},
25+
"returnType": {
26+
"type": "TSTypeAnnotation",
27+
"start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}},
28+
"typeAnnotation": {
29+
"type": "TSVoidKeyword",
30+
"start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25}}
31+
}
32+
},
33+
"id": null,
34+
"generator": false,
35+
"async": false,
36+
"params": [
37+
{
38+
"type": "RestElement",
39+
"start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}},
40+
"argument": {
41+
"type": "Identifier",
42+
"start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"args"},
43+
"name": "args"
44+
}
45+
}
46+
],
47+
"body": {
48+
"type": "BlockStatement",
49+
"start":29,"end":31,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":31}},
50+
"body": [],
51+
"directives": []
52+
}
53+
}
54+
}
55+
],
56+
"kind": "const"
57+
}
58+
],
59+
"directives": []
60+
}
61+
}

0 commit comments

Comments
 (0)