private void convertAwaitOfAsyncGenerator ( NodeTraversal t , LexicalContext ctx , Node awaitNode ) { checkNotNull ( awaitNode ) ; checkState ( awaitNode . isAwait ( ) ) ; checkState ( ctx != null && ctx . function != null ) ; checkState ( ctx . function . isAsyncGeneratorFunction ( ) ) ; Node expression = awaitNode . removeFirstChild ( ) ; checkNotNull ( expression , "await needs an expression" ) ; Node newActionRecord = astFactory . createNewNode ( astFactory . createQName ( t . getScope ( ) , ACTION_RECORD_NAME ) , astFactory . createQName ( t . getScope ( ) , ACTION_ENUM_AWAIT ) , expression ) ; newActionRecord . useSourceInfoIfMissingFromForTree ( awaitNode ) ; awaitNode . addChildToFront ( newActionRecord ) ; awaitNode . setToken ( Token . YIELD ) ; }
Converts an await into a yield of an ActionRecord to perform AWAIT .