-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScript
Milestone
Description
TypeScript Version: 3.9.6, 4 beta
Search Terms:
autofix convent to async function
Code
// The auto fix turns this code:
function stripAnsiOnRejection(p: Promise<unknown>) {
return p.catch((error: Error) => {
error.message = stripAnsi(error.message);
return Promise.reject(error);
});
}
// Into
async function stripAnsiOnRejection(p: Promise<unknown>) {
try {
return p;
}
catch (error) {
error.message = stripAnsi(error.message);
return Promise.reject(error);
}
}Expected behavior:
The return line should be return await p
Actual behavior:
The return line is return p
Related Issues: #31897
benjamingr, MadaraUchiha and a-tarasyuk
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript