src/com/google/javascript/jscomp/NodeUtil.java
/**
   * Temporary function to determine if a node is constant
   * in the old or new world. This does not check its inputs
   * carefully because it will go away once we switch to the new
   * world.
   */
Temporary function to determine if a node is constant
in the old or new world. This does not check its inputs
carefully because it will go away once we switch to the new
world.
Temporary function to determine if a node is constant in the old or new world . This does not check its inputs carefully because it will go away once we switch to the new world .
static boolean isConstantDeclaration(
      CodingConvention convention, JSDocInfo info, Node node) {
    if (node.isName() && node.getParent().isConst()) {
      return true;
    } else if (node.isName()
        && isLhsByDestructuring(node)
        && getRootTarget(node).getGrandparent().isConst()) {
      return true;
    }
    if (info != null && info.isConstant()) {
      return true;
    }
    if (node.getBooleanProp(Node.IS_CONSTANT_VAR)) {
      return true;
    }
    switch (node.getToken()) {
      case NAME:
        return NodeUtil.isConstantByConvention(convention, node);
      case GETPROP:
        return node.isQualifiedName()
            && NodeUtil.isConstantByConvention(convention, node.getLastChild());
      default:
        break;
    }
    return false;
  }
static boolean isConstantDeclaration ( CodingConvention convention , JSDocInfo info , Node node ) { if ( node . isName ( ) && node . getParent ( ) . isConst ( ) ) { return true ; } else if ( node . isName ( ) && isLhsByDestructuring ( node ) && getRootTarget ( node ) . getGrandparent ( ) . isConst ( ) ) { return true ; } if ( info != null && info . isConstant ( ) ) { return true ; } if ( node . getBooleanProp ( Node . IS_CONSTANT_VAR ) ) { return true ; } switch ( node . getToken ( ) ) { case NAME : return NodeUtil . isConstantByConvention ( convention , node ) ; case GETPROP : return node . isQualifiedName ( ) && NodeUtil . isConstantByConvention ( convention , node . getLastChild ( ) ) ; default : break ; } return false ; }
Temporary function to determine if a node is constant
 in the old or new world.
Temporary function to determine if a node is constant in the old or new world .
// TODO(b/77597706): Update this method to handle destructured declarations.