Closed
Description
From @chrfrasco on October 9, 2018 7:45
- VSCode Version: 1.28.0
- OS Version: macos 10.13.6
If/else is stripped out by convert to async refactor, and convert all to async does nothing
Steps to Reproduce:
- Convert
bar
to async function
function foo() {
return Promise.resolve(Math.random())
}
function bar() {
return foo()
.then(num => {
if (num > 0.5) {
return fetch("/big")
.then(() => 'big');
} else {
return fetch("/small")
.then(() => 'small');
}
})
.catch(() => -1);
}
- Get this
async function bar() {
try {
const num = await foo();
await fetch("/big");
return 'big';
await fetch("/small");
return 'small';
}
catch (e) {
return -1;
}
}
- convert all to async does nothing
Does this issue occur when all extensions are disabled?: Yes
Copied from original issue: microsoft/vscode#60257