add ParenthesizedExpression support to t.isDynamic

This commit is contained in:
Sebastian McKenzie
2014-11-26 00:40:42 +11:00
parent 9fb6681ad3
commit ff025e63ec

View File

@@ -114,7 +114,9 @@ t.shallowEqual = function (actual, expected) {
//
t.isDynamic = function (node) {
if (t.isIdentifier(node) || t.isLiteral(node) || t.isThisExpression(node)) {
if (t.isParenthesizedExpression(node)) {
return t.isDynamic(node.expression);
} else if (t.isIdentifier(node) || t.isLiteral(node) || t.isThisExpression(node)) {
return false;
} else if (t.isMemberExpression(node)) {
return t.isDynamic(node.object) || t.isDynamic(node.property);