acorn5-object-spread
Advanced tools
Comparing version 5.0.0 to 5.1.0
# acorn5-object-spread changelog | ||
## 5.1.0 | ||
* Make plugin compatible with acorn 5.3.x | ||
## 5.0.0 | ||
* Require acorn 5.2.x | ||
## 4.0.0 | ||
@@ -4,0 +12,0 @@ |
@@ -51,8 +51,11 @@ 'use strict'; | ||
instance.extend("checkLVal", getCheckLVal) | ||
instance.extend("toAssignable", nextMethod => function(node, isBinding) { | ||
// This backports toAssignable from 5.3.0 to 5.2.x | ||
instance.extend("toAssignable", nextMethod => function(node, isBinding, refDestructuringErrors) { | ||
if (this.options.ecmaVersion >= 6 && node) { | ||
if (node.type == "ObjectExpression") { | ||
node.type = "ObjectPattern" | ||
if (refDestructuringErrors) this.checkPatternErrors(refDestructuringErrors, true) | ||
for (let prop of node.properties) | ||
this.toAssignable(prop, isBinding) | ||
this.toAssignable(prop, isBinding, refDestructuringErrors) | ||
return node | ||
@@ -62,6 +65,6 @@ } else if (node.type === "Property") { | ||
if (node.kind !== "init") this.raise(node.key.start, "Object pattern can't contain getter or setter") | ||
return this.toAssignable(node.value, isBinding) | ||
return this.toAssignable(node.value, isBinding, refDestructuringErrors) | ||
} else if (node.type === "SpreadElement") { | ||
node.type = "RestElement" | ||
return this.toAssignable(node.argument, isBinding) | ||
return this.toAssignable(node.argument, isBinding, refDestructuringErrors) | ||
} | ||
@@ -68,0 +71,0 @@ } |
@@ -20,3 +20,3 @@ { | ||
}, | ||
"version": "5.0.0" | ||
"version": "5.1.0" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7867
83