Is this node the name of a block-scoped declaration?
Checks for let, const, class, or block-scoped function declarations.

@param n The node
@return True if {@code n} is the NAME of a block-scoped declaration.
483942
static boolean isBlockScopedDeclaration(Node n) {
    if (n.isName()) {
      switch (n.getParent().getToken()) {
        case LET:
        case CONST:
        case CATCH:
          return true;
        case CLASS:
          return n.getParent().getFirstChild() == n;
        case FUNCTION:
          return isBlockScopedFunctionDeclaration(n.getParent());
        default:
          break;
      }
    }
    return false;
  }
124620
function(name, nodes) {
          if (name !== 'declaration') {
            return false;
          }

          if (
              nodes.content[0] &&
              nodes.content[0].content &&
              nodes.content[0].content[0] &&
              nodes.content[0].content[0].type &&
              nodes.content[0].content[0].type === 'variable'
            ) {
            return true;
          }

        }
320433
private boolean isInMultipleLvalueDecl(Var v) {
    Token declarationType = v.declarationType();
    switch (declarationType) {
      case LET:
      case CONST:
      case VAR:
        Node nameDecl = NodeUtil.getEnclosingNode(v.getNode(), NodeUtil::isNameDeclaration);
        return NodeUtil.findLhsNodesInNode(nameDecl).size() > 1;
      default:
        return false;
    }
  }
281406
private boolean isJSDocOnFunctionNode(Node n, JSDocInfo info) {
    switch (n.getToken()) {
      case FUNCTION:
      case GETTER_DEF:
      case SETTER_DEF:
      case MEMBER_FUNCTION_DEF:
      case STRING_KEY:
      case COMPUTED_PROP:
      case EXPORT:
        return true;
      case GETELEM:
      case GETPROP:
        if (n.getFirstChild().isQualifiedName()) {
          // assume qualified names may be function declarations
          return true;
        }
        return false;
      case VAR:
      case LET:
      case CONST:
      case ASSIGN:
        {
          Node lhs = n.getFirstChild();
          Node rhs = NodeUtil.getRValueOfLValue(lhs);
          if (rhs != null && isClass(rhs) && !info.isConstructor()) {
            return false;
          }

          // TODO(b/124081098): Check that the RHS of the assignment is a
          // function. Note that it can be a FUNCTION node, but it can also be
          // a call to goog.abstractMethod, goog.functions.constant, etc.
          return true;
        }
      default:
        return false;
    }
  }
375960
function(node)
    {
      // declarations is an array of the comma-separated variable declarations like "var foo, zerp;"
      node.declarations.forEach(declaration =>
      {
        // id contains info about the variable being declare.
        var variable_name = declaration.id.name;
        // Skip if the variable is already whitelisted.
        if (variable_whitelist.indexOf(variable_name) > -1)
          return;

        // init contains info about the value being initialized to. It is null when the variable is
        // being declared without being initialized.
        // If initialization type is "CallExpression", that means that the variable is being
        // initialized to a function.
        // init.callee contains info about the function that the value is being initialized to,
        // undefined if it's not being initialized to a function, or at all.
        // So, this filters down into variables being initialized to the "require" function.
        if (declaration.init && declaration.init.type === `CallExpression` &&
        declaration.init.callee.name === `require`)
        {
          var module_name;
          // init.arguments is an array of the arguments being passed to the callee, undefinied if
          // the variable isn't being initialized to a function, or at all. Unlike the declarations,
          // we won't iterate over this because we only care about the first argument.
          if (declaration.init.arguments[0].type === `TemplateLiteral`)
            // The quasis array is a bit weird. Parsed template literals have them, and the number
            // of elements is equal to the number of placeholders, plus one for the non-placeholder
            // section. However, the values of the placeholder sections are always empty, so I'm
            // not sure what purpose they serve.
            // This takes the cooked non-placeholder portion as-is.
            module_name = declaration.init.arguments[0].quasis[0].value.cooked;
          else if (declaration.init.arguments[0].type === `Literal`)
            // Literals are easy. The value is right there.
            module_name = declaration.init.arguments[0].value;
          else
            // Something other than `, ', or "? ¯\_(ツ)_/¯
            return;
          // Detect if the module is being included via a path. This means that it is a part of the
          // project, and not from an external dependency. This means that it's alright to correct
          // the case in it.
          if (module_name.includes(`/`))
            variable_whitelist.push(variable_name);
        }
      });
    }
379793
public static boolean mayBeExpression(Node n) {
    switch (n.getToken()) {
      case FUNCTION:
      case CLASS:
        // FUNCTION and CLASS are used both in expression and statement
        // contexts.
        return true;

      case ADD:
      case AND:
      case ARRAYLIT:
      case ASSIGN:
      case ASSIGN_BITOR:
      case ASSIGN_BITXOR:
      case ASSIGN_BITAND:
      case ASSIGN_LSH:
      case ASSIGN_RSH:
      case ASSIGN_URSH:
      case ASSIGN_ADD:
      case ASSIGN_SUB:
      case ASSIGN_MUL:
      case ASSIGN_EXPONENT:
      case ASSIGN_DIV:
      case ASSIGN_MOD:
      case AWAIT:
      case BITAND:
      case BITOR:
      case BITNOT:
      case BITXOR:
      case CALL:
      case CAST:
      case COMMA:
      case DEC:
      case DELPROP:
      case DIV:
      case EQ:
      case EXPONENT:
      case FALSE:
      case GE:
      case GETPROP:
      case GETELEM:
      case GT:
      case HOOK:
      case IN:
      case INC:
      case INSTANCEOF:
      case LE:
      case LSH:
      case LT:
      case MOD:
      case MUL:
      case NAME:
      case NE:
      case NEG:
      case NEW:
      case NEW_TARGET:
      case NOT:
      case NUMBER:
      case NULL:
      case OBJECTLIT:
      case OR:
      case POS:
      case REGEXP:
      case RSH:
      case SHEQ:
      case SHNE:
      case STRING:
      case SUB:
      case SUPER:
      case TEMPLATELIT:
      case TAGGED_TEMPLATELIT:
      case THIS:
      case TYPEOF:
      case TRUE:
      case URSH:
      case VOID:
      case YIELD:
        return true;

      default:
        return false;
    }
  }
1085390
private boolean insideAssignmentToIdConstant(Node n) {
    Node parent = n.getParent();
    if (parent.isAssign()) {
      String qname = parent.getFirstChild().getQualifiedName();
      return qname != null && isIdName(qname);
    } else if (parent.isName()) {
      Node grandParent = parent.getParent();
      if (grandParent != null && NodeUtil.isNameDeclaration(grandParent)) {
        String name = parent.getString();
        return isIdName(name);
      } else {
        return false;
      }
    } else {
      return false;
    }
  }
149397
TypedScope createScope(Node n) {
    TypedScope s = memoized.get(n);
    return s != null
        ? s
        : createScope(n, createScope(NodeUtil.getEnclosingScopeRoot(n.getParent())));
  }
707721
static boolean referencesSuper(Node n) {
    Node curr = n.getFirstChild();
    while (curr != null) {
      if (containsType(curr, Token.SUPER, node -> !node.isClass())) {
        return true;
      }
      curr = curr.getNext();
    }
    return false;
  }
721556
public static boolean isLhsByDestructuring(Node n) {
    switch (n.getToken()) {
      case NAME:
      case GETPROP:
      case GETELEM:
        return isLhsByDestructuringHelper(n);
      default:
        return false;
    }
  }
1073444
static boolean isBleedingFunctionName(Node n) {
    if (!n.isName() || n.getString().isEmpty()) {
      return false;
    }
    Node parent = n.getParent();
    return isFunctionExpression(parent) && n == parent.getFirstChild();
  }
64593
public static boolean isControlStructure(Node n) {
    switch (n.getToken()) {
      case FOR:
      case FOR_IN:
      case FOR_OF:
      case FOR_AWAIT_OF:
      case DO:
      case WHILE:
      case WITH:
      case IF:
      case LABEL:
      case TRY:
      case CATCH:
      case SWITCH:
      case CASE:
      case DEFAULT_CASE:
        return true;
      default:
        return false;
    }
  }
40702
private boolean verifyDefine(NodeTraversal t, Node parent, Node methodName, Node args) {
    // Calls to goog.define must be in the global hoist scope.  This is copied from
    // validate(Un)aliasablePrimitiveCall.
    // TODO(sdh): loosen this restriction if the results are assigned?
    if (!compiler.getOptions().shouldPreserveGoogModule() && !t.inGlobalHoistScope()) {
      compiler.report(JSError.make(methodName.getParent(), INVALID_CLOSURE_CALL_SCOPE_ERROR));
      return false;
    }

    // It is an error for goog.define to show up anywhere except on its own or immediately after =.
    if (parent.isAssign() && parent.getParent().isExprResult()) {
      parent = parent.getParent();
    } else if (parent.isName() && NodeUtil.isNameDeclaration(parent.getParent())) {
      parent = parent.getParent();
    } else if (!parent.isExprResult()) {
      compiler.report(JSError.make(methodName.getParent(), INVALID_CLOSURE_CALL_SCOPE_ERROR));
      return false;
    }

    // Verify first arg
    Node arg = args;
    if (!verifyNotNull(methodName, arg) || !verifyOfType(methodName, arg, Token.STRING)) {
      return false;
    }

    // Verify second arg
    arg = arg.getNext();
    if (!args.isFromExterns()
        && (!verifyNotNull(methodName, arg) || !verifyIsLast(methodName, arg))) {
      return false;
    }

    String name = args.getString();
    if (!NodeUtil.isValidQualifiedName(
        compiler.getOptions().getLanguageIn().toFeatureSet(), name)) {
      compiler.report(JSError.make(args, INVALID_DEFINE_NAME_ERROR, name));
      return false;
    }

    JSDocInfo info = (parent.isExprResult() ? parent.getFirstChild() : parent).getJSDocInfo();
    if (info == null || !info.isDefine()) {
      compiler.report(JSError.make(parent, MISSING_DEFINE_ANNOTATION));
      return false;
    }
    return true;
  }
502520
static boolean isInvocationTarget(Node n) {
    Node parent = n.getParent();
    return parent != null && (isCallOrNew(parent) || parent.isTaggedTemplateLit())
        && parent.getFirstChild() == n;
  }
138034
function isBlockNode(node) {
        return node &&
            ((node.nodeType == 1 && !/^(inline(-block|-table)?|none)$/.test(getComputedDisplay(node))) ||
            node.nodeType == 9 || node.nodeType == 11);
    }
1312836
Var declare(String name, Node nameNode, CompilerInput input) {
    checkArgument(!name.isEmpty());
    // Make sure that it's declared only once
    checkState(getOwnSlot(name) == null);
    Var var = new Var(name, nameNode, this, getVarCount(), input);
    declareInternal(name, var);
    return var;
  }
64164
private boolean isBleedingFunctionName(String name) {
    V var = getVar(name);
    return var != null && var.getNode().getParent().isFunction();
  }