forked from sebastienros/jint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ValueTask and ValueTask<T> to Promise conversion (sebastienros#1744)
* Support ValueTask/ValueTask<T> in modern targets Adds new `IsAwaitable` and `ConvertAwaitableToPromise` methods. `IsAwaitable` checks if a result is a `Task`. For .NET Standard 2.1/.NET targets, the method also checks if a result is `ValueTask` or `ValueTask<T>`. If a result is awaitable, `Call` now calls `ConvertAwaitableToPromise`. This method makes use of the existing `ConvertTaskToPromise` method for `Task`-based results. For .NET Standard 2.1/.NET targets, it also handles conversion of `ValueTask`/`ValueTask<T>` results into `Task`/`Task<T>` before calling `ConvertTaskToPromise`. * Add ValueTask/ValueTask<T> tests
- Loading branch information
1 parent
5efd6e2
commit b47cb53
Showing
2 changed files
with
126 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