@@ -2590,14 +2590,17 @@ namespace ts {
25902590 transformFlags |= TransformFlags . AssertTypeScript ;
25912591 }
25922592
2593- // If a FunctionDeclaration has an asterisk token, is exported, or its
2594- // subtree has marked the container as needing to capture the lexical `this`,
2595- // then this node is ES6 syntax.
2593+ // If a FunctionDeclaration is exported or its subtree has marked the container as
2594+ // needing to capture the lexical `this`, then this node is ES6 syntax.
25962595 if ( subtreeFlags & TransformFlags . ES6FunctionSyntaxMask ) {
25972596 transformFlags |= TransformFlags . AssertES6 ;
25982597 }
25992598
2600- // Currently, we only support generators that were originally async function bodies.
2599+ // If a FunctionDeclaration is generator function and is the body of a
2600+ // transformed async function, then this node can be transformed to a
2601+ // down-level generator.
2602+ // Currently we do not support transforming any other generator fucntions
2603+ // down level.
26012604 if ( asteriskToken && node . emitFlags & NodeEmitFlags . AsyncFunctionBody ) {
26022605 transformFlags |= TransformFlags . AssertGenerator ;
26032606 }
@@ -2623,7 +2626,11 @@ namespace ts {
26232626 transformFlags |= TransformFlags . AssertES6 ;
26242627 }
26252628
2626- // Currently, we only support generators that were originally async function bodies.
2629+ // If a FunctionExpression is generator function and is the body of a
2630+ // transformed async function, then this node can be transformed to a
2631+ // down-level generator.
2632+ // Currently we do not support transforming any other generator fucntions
2633+ // down level.
26272634 if ( asteriskToken && node . emitFlags & NodeEmitFlags . AsyncFunctionBody ) {
26282635 transformFlags |= TransformFlags . AssertGenerator ;
26292636 }
0 commit comments