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);
  }
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".

<pre>{@code await myPromise}</pre>

<p>becomes

<pre>{@code yield new ActionRecord(ActionEnum.AWAIT_VALUE, myPromise)}</pre>

@param awaitNode the original await Node to be converted