Determines whether a node is required by the grammar to be wrapped in
parens, e.g. the test of an if statement.
@param {ASTNode} node - The AST node
@returns {boolean} True if parens around node belong to parent node.
437129
function requiresExtraParens(node) {
            return node.parent && parenthesized[node.parent.type] &&
                    node === node.parent[parenthesized[node.parent.type]];
        }
910972
function checkIfWithoutElse(node) {
            const parent = node.parent;

            /*
             * Fixing this would require splitting one statement into two, so no error should
             * be reported if this node is in a position where only one statement is allowed.
             */
            if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
                return;
            }

            const consequents = [];
            let alternate;

            for (let currentNode = node; currentNode.type === "IfStatement"; currentNode = currentNode.alternate) {
                if (!currentNode.alternate) {
                    return;
                }
                consequents.push(currentNode.consequent);
                alternate = currentNode.alternate;
            }

            if (consequents.every(alwaysReturns)) {
                displayReport(alternate);
            }
        }
783371
function parse (node, self) {
  let block = false

  if (node.nodeType === 3) {
    let delimiters = self.templateDelimiters

    if (delimiters) {
      let tokens = parseTemplate(node.data, delimiters)

      if (tokens.length) {
        if (!(tokens.length === 1 && tokens[0].type === 0)) {
          tokens.forEach((token, i) => {
            let text = document.createTextNode(token.value)
            node.parentNode.insertBefore(text, node)

            if (token.type === 1) {
              self.buildBinding(TextBinding, text, null, token.value)
            }
          })

          node.parentNode.removeChild(node)
        }
      }
    }
  } else if (node.nodeType === 1) {
    block = self.traverse(node)
  }

  if (!block) {
    Array.prototype.slice.call(node.childNodes).forEach(function (node) { parse(node, self) })
  }
}
150618
function isHelper(node) {
  if (t.isMemberExpression(node)) {
    return isHelper(node.object) || isHelper(node.property);
  } else if (t.isIdentifier(node)) {
    return node.name === "require" || node.name[0] === "_";
  } else if (t.isCallExpression(node)) {
    return isHelper(node.callee);
  } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
    return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
  } else {
    return false;
  }
}
1085623
static boolean isAliasedConstDefinition(Node lhs) {
    JSDocInfo jsdoc = getBestJSDocInfo(lhs);
    if (jsdoc == null && !lhs.isFromExterns()) {
      return false;
    }
    if (jsdoc != null && !jsdoc.hasConstAnnotation()) {
      return false;
    }
    Node rhs = getRValueOfLValue(lhs);
    if (rhs == null || !rhs.isQualifiedName()) {
      return false;
    }
    Node parent = lhs.getParent();
    return (lhs.isName() && parent.isVar())
        || (lhs.isGetProp() && lhs.isQualifiedName()
            && parent.isAssign() && parent.getParent().isExprResult());
  }
369532
protected function isDeclaration(ParentNode $node) {
    return $node instanceof FunctionDeclarationNode ||
      $node instanceof SingleInheritanceNode ||
      $node instanceof InterfaceNode ||
      $node instanceof ClassMethodNode ||
      $node instanceof InterfaceMethodNode;
  }
384682
function (node) {
        var parent = node._parent;
        while(parent) {
            if (parent === this) {
                return true;
            }
            parent = parent._parent;
        }
        return false;
    }
390924
function(node) {
            var parent = node.getParent();
            while(parent) {
                if(parent._id === this._id) {
                    return true;
                }
                parent = parent.getParent();
            }

            return false;
        }
1029393
function validateParens(parens, elements) {
            const leftParen = parens.leftParen;
            const rightParen = parens.rightParen;
            const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
            const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen);
            const hasLeftNewline = !astUtils.isTokenOnSameLine(leftParen, tokenAfterLeftParen);
            const hasRightNewline = !astUtils.isTokenOnSameLine(tokenBeforeRightParen, rightParen);
            const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline);

            if (hasLeftNewline && !needsNewlines) {
                context.report({
                    node: leftParen,
                    messageId: "unexpectedAfter",
                    fix(fixer) {
                        return sourceCode.getText().slice(leftParen.range[1], tokenAfterLeftParen.range[0]).trim()

                            // If there is a comment between the ( and the first element, don't do a fix.
                            ? null
                            : fixer.removeRange([leftParen.range[1], tokenAfterLeftParen.range[0]]);
                    }
                });
            } else if (!hasLeftNewline && needsNewlines) {
                context.report({
                    node: leftParen,
                    messageId: "expectedAfter",
                    fix: fixer => fixer.insertTextAfter(leftParen, "\n")
                });
            }

            if (hasRightNewline && !needsNewlines) {
                context.report({
                    node: rightParen,
                    messageId: "unexpectedBefore",
                    fix(fixer) {
                        return sourceCode.getText().slice(tokenBeforeRightParen.range[1], rightParen.range[0]).trim()

                            // If there is a comment between the last element and the ), don't do a fix.
                            ? null
                            : fixer.removeRange([tokenBeforeRightParen.range[1], rightParen.range[0]]);
                    }
                });
            } else if (!hasRightNewline && needsNewlines) {
                context.report({
                    node: rightParen,
                    messageId: "expectedBefore",
                    fix: fixer => fixer.insertTextBefore(rightParen, "\n")
                });
            }
        }
530178
function (node) {
        var parent = node;

        while (parent) {
          if (parent.nodeType === 1 && dom.getContentEditable(parent)) {
            return dom.getContentEditable(parent) === "false" ? parent : node;
          }

          parent = parent.parentNode;
        }

        return node;
      }
933285
function checkArrowFunc(node) {
            const body = node.body;

            if (isConditional(body) && !(allowParens && astUtils.isParenthesised(sourceCode, body))) {
                context.report({
                    node,
                    messageId: "confusing",
                    fix(fixer) {

                        // if `allowParens` is not set to true dont bother wrapping in parens
                        return allowParens && fixer.replaceText(node.body, `(${sourceCode.getText(node.body)})`);
                    }
                });
            }
        }
1116520
function isLooped(node, parent) {
    switch (parent.type) {
        case "ForStatement":
            return (
                node === parent.test ||
                node === parent.update ||
                node === parent.body
            );

        case "ForOfStatement":
        case "ForInStatement":
            return node === parent.body;

        case "WhileStatement":
        case "DoWhileStatement":
            return node === parent.test || node === parent.body;

        default:
            return false;
    }
}
947336
function isParent(node, file){
	while (node && node.parent && node.file) {
		if (node.file == file) {
			return true;
		}
		node = node.parent;
	}
	return false;
}
40167
function isValidElement (node) {
  const name = node.name
  return (
    name === 'input' ||
    name === 'select' ||
    name === 'textarea' ||
    (
      name !== 'keep-alive' &&
      name !== 'slot' &&
      name !== 'transition' &&
      name !== 'transition-group' &&
      utils.isCustomComponent(node)
    )
  )
}
1170253
function (node) {
            var len = nodeLength(node);

            if (len === 0) {
                return true;
            } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {
                // ex) <p><br></p>, <span><br></span>
                return true;
            } else if (list.all(node.childNodes, isText) && node.innerHTML === '') {
                // ex) <p></p>, <span></span>
                return true;
            }

            return false;
        }
702618
function( ancestor, descendant, within )
    {
        var node = within ? descendant.parentNode : descendant;
        while( node )
        {
            if( node === ancestor )
                return true;
            node = node.parentNode;
        }
        return false;
    }
204159
public boolean isAncestor(XMLNode node) {
		return node == parent || (parent != null && parent.isAncestor(node));
	}