File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
testRunner/unittests/services Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,11 @@ namespace ts {
174
174
switch ( arg . kind ) {
175
175
case SyntaxKind . FunctionDeclaration :
176
176
case SyntaxKind . FunctionExpression :
177
+ const functionFlags = getFunctionFlags ( arg as FunctionDeclaration | FunctionExpression ) ;
178
+ if ( functionFlags & FunctionFlags . Generator ) {
179
+ return false ;
180
+ }
181
+ // falls through
177
182
case SyntaxKind . ArrowFunction :
178
183
visitedNestedConvertibleFunctions . set ( getKeyFromNode ( arg as FunctionLikeDeclaration ) , true ) ;
179
184
// falls through
Original file line number Diff line number Diff line change @@ -1706,6 +1706,16 @@ class Foo {
1706
1706
return Promise.resolve(1).then(n => n);
1707
1707
}
1708
1708
}
1709
+ ` ) ;
1710
+
1711
+ _testConvertToAsyncFunctionFailed ( "convertToAsyncFunction__NoSuggestionForGeneratorCallbacks" , `
1712
+ function [#|foo|](p: Promise<string[]>) {
1713
+ return p.then(function* (strings) {
1714
+ for (const s of strings) {
1715
+ yield s.toUpperCase();
1716
+ }
1717
+ });
1718
+ }
1709
1719
` ) ;
1710
1720
1711
1721
} ) ;
You can’t perform that action at this time.
0 commit comments