bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/no-unused-expressions.js
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);
				}
			}

			return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) ||
				(node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0);
		}
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);
				}
			}

			return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) ||
				(node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0);
		}
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 ) ; } } return / ^(?:Assignment|Call|New|Update|Yield)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
Determines whether or not a given node is a valid expression . Recurses on short circuit eval and ternary nodes if enabled by flags .