private static Node getConstantDeclValue ( Node name ) { Node parent = name . getParent ( ) ; if ( parent == null ) { return null ; } if ( name . isName ( ) ) { if ( parent . isConst ( ) ) { return name . getFirstChild ( ) ; } else if ( ! parent . isVar ( ) ) { return null ; } JSDocInfo jsdoc = NodeUtil . getBestJSDocInfo ( name ) ; return jsdoc != null && jsdoc . isConstant ( ) ? name . getFirstChild ( ) : null ; } else if ( name . isGetProp ( ) && parent . isAssign ( ) ) { JSDocInfo jsdoc = NodeUtil . getBestJSDocInfo ( name ) ; return jsdoc != null && jsdoc . isConstant ( ) ? name . getNext ( ) : null ; } return null ; }
Checks whether the NAME node is inside either a CONST or a