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
18 lines
393 B
TypeScript
18 lines
393 B
TypeScript
// ==ORIGINAL==
|
|
|
|
function /*[#|*/f/*|]*/() {
|
|
return fetch(Promise.resolve(1).then(res => "https://typescriptlang.org")).catch(err => console.log(err));
|
|
}
|
|
|
|
|
|
// ==ASYNC FUNCTION::Convert to async function==
|
|
|
|
async function f() {
|
|
try {
|
|
return await fetch(Promise.resolve(1).then(res => "https://typescriptlang.org"));
|
|
} catch (err) {
|
|
return console.log(err);
|
|
}
|
|
}
|
|
|