static boolean isConstantDeclaration ( CodingConvention convention , JSDocInfo info , Node node ) { // TODO(b/77597706): Update this method to handle destructured declarations. 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 . This does not check its inputs carefully because it will go away once we switch to the new world .