-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
⚙ Compilation target
ESNext / ES2025
⚙ Library
ESNext / ES2025
Missing / Incorrect Definition
Last week, Promise.try
got into stage 4. Not sure if this is already in scope for the upcoming TS release, just adding this ticket to track this.
Sample Code
function doSomething(action) {
return Promise.try(action)
.then((result) => console.log(result))
.catch((error) => console.error(error))
.finally(() => console.log("Done"));
}
doSomething(() => "Sync result");
doSomething(() => {
throw new Error("Sync error");
});
doSomething(async () => "Async result");
doSomething(async () => {
throw new Error("Async error");
});
Documentation Link
btoo
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this