-
-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental support for Task to Promise conversion (#1567)
This commit fixes an issue where an `async Task` (be it a method or a delegate) would end up being marshalled directly to JS, giving a `Task<VoidTaskResult>` to the user, instead of `undefined`, which is what is returned for "synchronous tasks", i.e. any Task-returning invokable function that does not generate an async state machine of its own (that is to say, any function that returns `Task`, not `async Task`. This commit fixes the issue by checking if a Task's result is equal to `VoidTaskResult`, which is an internal type used by the runtime to indicate a void-returning Task, such as that from an `async Task` method/delegate --------- Co-authored-by: Velvet Toroyashi <[email protected]>
- Loading branch information
1 parent
1697fc3
commit c905f53
Showing
2 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
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