ast-types
Advanced tools
Comparing version 0.3.34 to 0.3.35
@@ -83,3 +83,4 @@ require("./core"); | ||
.field("method", isBoolean, defaults["false"]) | ||
.field("shorthand", isBoolean, defaults["false"]); | ||
.field("shorthand", isBoolean, defaults["false"]) | ||
.field("computed", isBoolean, defaults["false"]); | ||
@@ -86,0 +87,0 @@ def("MethodDefinition") |
@@ -35,2 +35,2 @@ require("./core"); | ||
.field("argument", or(def("Expression"), null)) | ||
.field("all", isBoolean, false); | ||
.field("all", isBoolean, defaults["false"]); |
@@ -132,3 +132,3 @@ var assert = require("assert"); | ||
if (n.UnaryExpression.check(node)) | ||
if (isUnaryLike(node)) | ||
return n.MemberExpression.check(parent) | ||
@@ -145,3 +145,3 @@ && this.name === "object" | ||
if (n.UnaryExpression.check(parent)) | ||
if (isUnaryLike(parent)) | ||
return true; | ||
@@ -197,3 +197,3 @@ | ||
|| n.ConditionalExpression.check(parent) | ||
|| n.UnaryExpression.check(parent) | ||
|| isUnaryLike(parent) | ||
|| n.YieldExpression.check(parent); | ||
@@ -217,3 +217,3 @@ | ||
n.ConditionalExpression.check(node)) { | ||
if (n.UnaryExpression.check(parent)) | ||
if (isUnaryLike(parent)) | ||
return true; | ||
@@ -256,2 +256,10 @@ | ||
function isUnaryLike(node) { | ||
return n.UnaryExpression.check(node) | ||
// I considered making SpreadElement and SpreadProperty subtypes | ||
// of UnaryExpression, but they're not really Expression nodes. | ||
|| (n.SpreadElement && n.SpreadElement.check(node)) | ||
|| (n.SpreadProperty && n.SpreadProperty.check(node)); | ||
} | ||
var PRECEDENCE = {}; | ||
@@ -258,0 +266,0 @@ [["||"], |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "0.3.34", | ||
"version": "0.3.35", | ||
"homepage": "http://github.com/benjamn/ast-types", | ||
@@ -24,0 +24,0 @@ "repository": { |
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
436558
12150