ast-types
Advanced tools
Comparing version 0.3.29 to 0.3.30
@@ -170,13 +170,21 @@ var assert = require("assert"); | ||
if (n.SequenceExpression.check(node)) | ||
return n.CallExpression.check(parent) | ||
|| n.UnaryExpression.check(parent) | ||
|| isBinary(parent) | ||
|| n.VariableDeclarator.check(parent) | ||
|| n.MemberExpression.check(parent) | ||
|| n.ArrayExpression.check(parent) | ||
|| n.Property.check(parent) | ||
|| n.ConditionalExpression.check(parent) | ||
|| n.AssignmentExpression.check(parent); | ||
if (n.SequenceExpression.check(node)) { | ||
if (n.ForStatement.check(parent)) { | ||
// Although parentheses wouldn't hurt around sequence | ||
// expressions in the head of for loops, traditional style | ||
// dictates that e.g. i++, j++ should not be wrapped with | ||
// parentheses. | ||
return false; | ||
} | ||
if (n.ExpressionStatement.check(parent) && | ||
this.name === "expression") { | ||
return false; | ||
} | ||
// Otherwise err on the side of overparenthesization, adding | ||
// explicit exceptions above if this proves overzealous. | ||
return true; | ||
} | ||
if (n.YieldExpression.check(node)) | ||
@@ -183,0 +191,0 @@ return isBinary(parent) |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "0.3.29", | ||
"version": "0.3.30", | ||
"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
433832
12071