function isValidExpression(node){if(allowTernary){// Recursive check for ternary and logical expressions
if(node.type==="ConditionalExpression"){return isValidExpression(node.consequent)&&isValidExpression(node.alternate);}}if(allowShortCircuit){if(node.type==="LogicalExpression"){return isValidExpression(node.right);}}if(allowTaggedTemplates&&node.type==="TaggedTemplateExpression"){return true;}return /^(?:Assignment|Call|New|Update|Yield|Await)Expression$/.test(node.type)||node.type==="UnaryExpression"&&["delete","void"].indexOf(node.operator)>=0;}
Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags.
@param {ASTNode} node - any node
@returns {boolean} whether the given node is a valid expression