private void visitFallbackFunctionCall ( NodeTraversal t , Node call ) { // Check to make sure the function call looks like: // goog.getMsgWithFallback(MSG_1, MSG_2); if ( call . getChildCount ( ) != 3 || ! call . getSecondChild ( ) . isName ( ) || ! call . getLastChild ( ) . isName ( ) ) { compiler . report ( JSError . make ( call , BAD_FALLBACK_SYNTAX ) ) ; return ; } Node firstArg = call . getSecondChild ( ) ; String name = firstArg . getOriginalName ( ) ; if ( name == null ) { name = firstArg . getString ( ) ; } JsMessage firstMessage = getTrackedMessage ( t , name ) ; if ( firstMessage == null ) { compiler . report ( JSError . make ( firstArg , FALLBACK_ARG_ERROR , name ) ) ; return ; } Node secondArg = firstArg . getNext ( ) ; name = secondArg . getOriginalName ( ) ; if ( name == null ) { name = secondArg . getString ( ) ; } JsMessage secondMessage = getTrackedMessage ( t , name ) ; if ( secondMessage == null ) { compiler . report ( JSError . make ( secondArg , FALLBACK_ARG_ERROR , name ) ) ; return ; } processMessageFallback ( call , firstMessage , secondMessage ) ; }
Visit a call to goog . getMsgWithFallback .