fix spread properties in assignment position - fixes #1315

This commit is contained in:
Sebastian McKenzie 2015-04-21 16:24:34 +01:00
parent 5f1c3c3b8d
commit 562dba872d

View File

@ -21,6 +21,7 @@ pp.toAssignable = function(node, isBinding) {
node.type = "ObjectPattern"
for (let i = 0; i < node.properties.length; i++) {
let prop = node.properties[i]
if (prop.type === "SpreadProperty") continue;
if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter")
this.toAssignable(prop.value, isBinding)
}