-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to deno_core 0.224.0 and V8 12.0. --------- Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
- Loading branch information
1 parent
01d3e0f
commit 1d19b10
Showing
6 changed files
with
44 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The promise generic type is
T
, yet — unconditionally — thevalue
parameter of theresolve
function is optional (and therefore its union includesundefined
). This is a contradiction which causes a type-safety issue (demonstrated below). If markingvalue
as optional wasn't an accident, it would be better to conditionally mark it as optional only whenT
can be extended byvoid
orundefined
.example.ts
:The reference TypeScript implementation that's linked to by the proposal looks like this:
And the types can also be defined by derivation from the
Promise
constructor callback function:Code in TS Playground