forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request microsoft#29214 from uniqueiniquity/nestedAsyncCod…
…eFix Only provide suggestion for outermost async fix
- Loading branch information
Showing
21 changed files
with
134 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...baselines/reference/convertToAsyncFunction/convertToAsyncFunction_OutermostOnlyFailure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// ==ORIGINAL== | ||
|
||
function foo() { | ||
return fetch('a').then(/*[#|*/() => {/*|]*/ | ||
return fetch('b').then(() => 'c'); | ||
}) | ||
} | ||
|
||
// ==ASYNC FUNCTION::Convert to async function== | ||
|
||
function foo() { | ||
return fetch('a').then(async () => { | ||
await fetch('b'); | ||
return 'c'; | ||
}) | ||
} |
15 changes: 15 additions & 0 deletions
15
...baselines/reference/convertToAsyncFunction/convertToAsyncFunction_OutermostOnlySuccess.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ==ORIGINAL== | ||
|
||
function /*[#|*/foo/*|]*/() { | ||
return fetch('a').then(() => { | ||
return fetch('b').then(() => 'c'); | ||
}) | ||
} | ||
|
||
// ==ASYNC FUNCTION::Convert to async function== | ||
|
||
async function foo() { | ||
await fetch('a'); | ||
await fetch('b'); | ||
return 'c'; | ||
} |
15 changes: 15 additions & 0 deletions
15
...baselines/reference/convertToAsyncFunction/convertToAsyncFunction_OutermostOnlySuccess.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// ==ORIGINAL== | ||
|
||
function /*[#|*/foo/*|]*/() { | ||
return fetch('a').then(() => { | ||
return fetch('b').then(() => 'c'); | ||
}) | ||
} | ||
|
||
// ==ASYNC FUNCTION::Convert to async function== | ||
|
||
async function foo() { | ||
await fetch('a'); | ||
await fetch('b'); | ||
return 'c'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.