@@ -2590,14 +2590,17 @@ namespace ts {
2590
2590
transformFlags |= TransformFlags . AssertTypeScript ;
2591
2591
}
2592
2592
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.
2596
2595
if ( subtreeFlags & TransformFlags . ES6FunctionSyntaxMask ) {
2597
2596
transformFlags |= TransformFlags . AssertES6 ;
2598
2597
}
2599
2598
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.
2601
2604
if ( asteriskToken && node . emitFlags & NodeEmitFlags . AsyncFunctionBody ) {
2602
2605
transformFlags |= TransformFlags . AssertGenerator ;
2603
2606
}
@@ -2623,7 +2626,11 @@ namespace ts {
2623
2626
transformFlags |= TransformFlags . AssertES6 ;
2624
2627
}
2625
2628
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.
2627
2634
if ( asteriskToken && node . emitFlags & NodeEmitFlags . AsyncFunctionBody ) {
2628
2635
transformFlags |= TransformFlags . AssertGenerator ;
2629
2636
}
0 commit comments