Checks for object literal method
@param {ASTNode} node The AST node being checked.
@returns true if parent node is a call expression and is part of an object literal
190870
function isMethodCall(node) {
                    var nodeParentType = node.parent.type,
                        nodeParentParentParentType = node.parent.parent.parent.type;

                    if (nodeParentType === "CallExpression" && nodeParentParentParentType === "BlockStatement" && !variable) {
                        return true;
                    } else {
                        return false;
                    }
                }
41978
private static boolean isCallTo(Node n, Node targetMethod) {
    if (!n.isCall()) {
      return false;
    }
    Node method = n.getFirstChild();
    return method.isGetProp() && method.matchesQualifiedName(targetMethod);
  }
1314787
function isFunctionExpression(node) {
    if (node && node.callee && node.callee.type === 'FunctionExpression') {
        return true;
    }
    return false;
}
1246679
function isArgumentLiteral (node) {
  return node.arguments && node.arguments.length && node.arguments[0].type === 'Literal'
}
717960
function checkCallExpression(node) {
            // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true
            checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments);
            var signature = getResolvedSignature(node);
            if (node.expression.kind === 95 /* SuperKeyword */) {
                return voidType;
            }
            if (node.kind === 175 /* NewExpression */) {
                var declaration = signature.declaration;
                if (declaration &&
                    declaration.kind !== 148 /* Constructor */ &&
                    declaration.kind !== 152 /* ConstructSignature */ &&
                    declaration.kind !== 157 /* ConstructorType */ &&
                    !ts.isJSDocConstructSignature(declaration)) {
                    // When resolved signature is a call signature (and not a construct signature) the result type is any, unless
                    // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations
                    // in a JS file
                    // Note:JS inferred classes might come from a variable declaration instead of a function declaration.
                    // In this case, using getResolvedSymbol directly is required to avoid losing the members from the declaration.
                    var funcSymbol = node.expression.kind === 69 /* Identifier */ ?
                        getResolvedSymbol(node.expression) :
                        checkExpression(node.expression).symbol;
                    if (funcSymbol && funcSymbol.members && (funcSymbol.flags & 16 /* Function */ || ts.isDeclarationOfFunctionExpression(funcSymbol))) {
                        return getInferredClassType(funcSymbol);
                    }
                    else if (compilerOptions.noImplicitAny) {
                        error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);
                    }
                    return anyType;
                }
            }
            // In JavaScript files, calls to any identifier 'require' are treated as external module imports
            if (ts.isInJavaScriptFile(node) && ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) {
                return resolveExternalModuleTypeByLiteral(node.arguments[0]);
            }
            return getReturnTypeOfSignature(signature);
        }
981760
function(node) {

        var parent = node.parent;

        switch (node.type) {
            case "ClassDeclaration":
            case "FunctionDeclaration":
                if (looksLikeExport(parent)) {
                    return findJSDocComment(parent.leadingComments, parent.loc.start.line);
                }
                return findJSDocComment(node.leadingComments, node.loc.start.line);

            case "ClassExpression":
                return findJSDocComment(parent.parent.leadingComments, parent.parent.loc.start.line);

            case "ArrowFunctionExpression":
            case "FunctionExpression":

                if (parent.type !== "CallExpression" && parent.type !== "NewExpression") {
                    while (parent && !parent.leadingComments && !/Function/.test(parent.type) && parent.type !== "MethodDefinition" && parent.type !== "Property") {
                        parent = parent.parent;
                    }

                    return parent && parent.type !== "FunctionDeclaration" ? findJSDocComment(parent.leadingComments, parent.loc.start.line) : null;
                } else if (node.leadingComments) {
                    return findJSDocComment(node.leadingComments, node.loc.start.line);
                }

            // falls through

            default:
                return null;
        }
    }
193595
function checkFunction(node) {
            if (!node.generator) {
                return;
            }

            const starToken = getStarToken(node);
            const prevToken = sourceCode.getTokenBefore(starToken);
            const nextToken = sourceCode.getTokenAfter(starToken);

            let kind = "named";

            if (node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method)) {
                kind = "method";
            } else if (!node.id) {
                kind = "anonymous";
            }

            // Only check before when preceded by `function`|`static` keyword
            if (!(kind === "method" && starToken === sourceCode.getFirstToken(node.parent))) {
                checkSpacing(kind, "before", prevToken, starToken);
            }

            checkSpacing(kind, "after", starToken, nextToken);
        }
384682
function (node) {
        var parent = node._parent;
        while(parent) {
            if (parent === this) {
                return true;
            }
            parent = parent._parent;
        }
        return false;
    }
438540
function isLocalCall (node) {
  return nodeType(node, exactMatch(nodeTypes.FUNCTIONCALL)) &&
        minNrOfChildren(node, 1) &&
        nodeType(node.children[0], exactMatch(nodeTypes.IDENTIFIER)) &&
        expressionType(node.children[0], basicRegex.FUNCTIONTYPE) &&
        !expressionType(node.children[0], basicRegex.EXTERNALFUNCTIONTYPE) &&
        nrOfChildren(node.children[0], 0)
}
1287215
function isCallToMethod(node, version, method) {
    return methodDataUtil.isAliasOfMethod(version, method, astUtil.getMethodName(node))
}
673209
function checkCodeDoesNotInterfere(astNode, exprKey, isExpression) {
      let expr = astNode[exprKey];
      const seen = new Set();

      const type = typeof expr;
      if (type !== 'string') {
        // expr may be true, not "true".
        // This occurs for inferred expressions like valueless attributes.
        expr = `${ expr }`;
        astNode[exprKey] = expr;
      }

      let warnedPug = false;
      let warnedModule = false;
      // Allows check to take into account the context in which a node appears.
      // Flattened pairs of [ancestor, keyInAncestorToDescendent].
      const jsAstPath = [];

      function check(jsAst) {
        if (jsAst && typeof jsAst === 'object' && jsAst.type === 'Identifier') {
          const { name } = jsAst;
          if (/^pug_/.test(name) || name === 'eval') {
            if (!warnedPug) {
              distrust(`Expression (${ expr }) may interfere with PUG internals ${ jsAst.name }`);
              warnedPug = true;
            }
          } else if (name === 'require' &&
                     // Allow trusted plugin code to require modules they need.
                     !(Object.hasOwnProperty.call(astNode, 'mayRequire') && astNode.mayRequire) &&
                     // Allow require.moduleKeys and require.resolve but not require(moduleId).
                     !(jsAstPath.length && jsAstPath[jsAstPath.length - 2].type === 'MemberExpression' &&
                       jsAstPath[jsAstPath.length - 1] === 'object')) {
            // Defang expression.
            astNode[exprKey] = 'null';
            // We trust trusted plugin code and PUG code to use the module's private key
            // but not template code.
            if (!warnedModule) {
              distrust(`Expression (${ expr }) may interfere with module internals ${ jsAst.name }`);
              warnedModule = true;
            }
          }
        }
        checkChildren(jsAst); // eslint-disable-line no-use-before-define
      }

      function checkChildren(jsAst) {
        if (!seen.has(jsAst)) {
          seen.add(jsAst);
          const jsAstPathLength = jsAstPath.length;
          jsAstPath[jsAstPathLength] = jsAst;
          for (const key in jsAst) {
            if (Object.hasOwnProperty.call(jsAst, key)) {
              jsAstPath[jsAstPathLength + 1] = key;
              check(jsAst[key]);
            }
          }
          jsAstPath.length = jsAstPathLength;
        }
      }

      let root = null;
      try {
        root = isExpression ? parseExpression(expr) : parse(expr);
      } catch (exc) {
        distrust(`Malformed expression (${ expr })`);
        return;
      }
      check(root);
    }
755451
function isWrappedInParenthesis(node) {
            const regex = /^return\s*?\(\s*?\);*?/u;

            const statementWithoutArgument = sourceCode.getText(node).replace(
                sourceCode.getText(node.argument), ""
            );

            return regex.test(statementWithoutArgument);
        }
1088100
function CallExpression(node) {
    if (t.isFunction(node.callee) || isHelper(node)) {
      return {
        before: true,
        after: true
      };
    }
  }
1194605
function isEmbedded(node) {
            if (!node.parent) {
                return false;
            }
            if (node !== node.parent.value) {
                return false;
            }
            if (node.parent.type === "MethodDefinition") {
                return true;
            }
            if (node.parent.type === "Property") {
                return node.parent.method === true || node.parent.kind === "get" || node.parent.kind === "set";
            }
            return false;
        }
862881
function(node) {
    if (node.type !== 'AssignmentExpression') return false;

    return node.left.type === 'MemberExpression' &&
      node.left.object.type === 'Identifier' && node.left.object.name === 'module' &&
      node.left.property.type === 'Identifier' && node.left.property.name === 'exports';
    // TODO: detect module.exports.foo = (or exports.foo =) property assignments, non-default exports
  }
318588
function isScope(node, parent) {
  if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) {
    return false;
  }

  return t.isScopable(node);
}
1090607
function isDirective(node, sourceCode) {
    return (
        node.type === "ExpressionStatement" &&
        (
            node.parent.type === "Program" ||
            (
                node.parent.type === "BlockStatement" &&
                astUtils.isFunction(node.parent.parent)
            )
        ) &&
        node.expression.type === "Literal" &&
        typeof node.expression.value === "string" &&
        !astUtils.isParenthesised(sourceCode, node.expression)
    );
}