acorn5-object-spread
Advanced tools
Comparing version 5.1.0 to 5.1.1
# acorn5-object-spread changelog | ||
## 5.1.1 | ||
* Backport check for default values from acorn 5.3.0 | ||
## 5.1.0 | ||
@@ -4,0 +8,0 @@ |
@@ -67,3 +67,6 @@ 'use strict'; | ||
node.type = "RestElement" | ||
return this.toAssignable(node.argument, isBinding, refDestructuringErrors) | ||
this.toAssignable(node.argument, isBinding, refDestructuringErrors) | ||
if (node.argument.type === "AssignmentPattern") | ||
this.raise(node.argument.start, "Rest elements cannot have a default value") | ||
return | ||
} | ||
@@ -73,2 +76,12 @@ } | ||
}) | ||
instance.extend("toAssignableList", nextMethod => function (exprList, isBinding) { | ||
const result = nextMethod.call(this, exprList, isBinding) | ||
if (exprList.length && exprList[exprList.length - 1] && exprList[exprList.length - 1].type === "RestElement") { | ||
// Backport check from 5.3.0 | ||
if (exprList[exprList.length - 1].argument.type === "AssignmentPattern") | ||
this.raise(exprList[exprList.length - 1].argument.start, "Rest elements cannot have a default value") | ||
} | ||
return result | ||
}) | ||
instance.extend("checkPatternExport", nextMethod => function(exports, pat) { | ||
@@ -75,0 +88,0 @@ if (pat.type == "ObjectPattern") { |
@@ -20,3 +20,3 @@ { | ||
}, | ||
"version": "5.1.0" | ||
"version": "5.1.1" | ||
} |
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
8623
95