correctly handle SpreadProperty - fixes babel/babel#897
This commit is contained in:
parent
631b78e07d
commit
1424c35d13
3
acorn.js
3
acorn.js
@ -2312,6 +2312,7 @@
|
||||
case "Identifier":
|
||||
case "VirtualPropertyExpression":
|
||||
case "MemberExpression":
|
||||
case "SpreadProperty":
|
||||
case "ObjectPattern":
|
||||
case "ArrayPattern":
|
||||
case "AssignmentPattern":
|
||||
@ -2321,6 +2322,8 @@
|
||||
node.type = "ObjectPattern";
|
||||
for (var i = 0; i < node.properties.length; i++) {
|
||||
var prop = node.properties[i];
|
||||
if (prop.type === "SpreadProperty") continue;
|
||||
|
||||
if (prop.kind !== "init") raise(prop.key.start, "Object pattern can't contain getter or setter");
|
||||
toAssignable(prop.value, isBinding);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user