6f7f3b1775
* Minor fixes to convertToAsync * Back out on nested return in inner continuation * Baseline update * Verify type argument for call can be used, add a few more early exit shortcuts
16 lines
384 B
TypeScript
16 lines
384 B
TypeScript
// ==ORIGINAL==
|
|
|
|
declare function foo(): Promise<number>;
|
|
function /*[#|*/f/*|]*/(): Promise<number> {
|
|
return foo().finally(() => console.log("done"));
|
|
}
|
|
// ==ASYNC FUNCTION::Convert to async function==
|
|
|
|
declare function foo(): Promise<number>;
|
|
async function f(): Promise<number> {
|
|
try {
|
|
return await foo();
|
|
} finally {
|
|
return console.log("done");
|
|
}
|
|
} |