Skip to content

Fix some Embedded Swift issues in JavaScriptEventLoop #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

MaxDesiatov
Copy link
Contributor

This change fixes some of the issues that appear when building this library with Embedded Swift. It adds missing concurrency imports and avoids use of throwing tasks that are not supported in Embedded Swift. Standard Swift's Result type is used instead to express error throwing.

This change fixes some of the issues that appear when building this library with Embedded Swift. It adds missing concurrency imports and avoids use of throwing tasks that are not supported in Embedded Swift. Standard Swift's `Result` type is used instead to express error throwing.
@MaxDesiatov MaxDesiatov changed the title Fix some Embedded Swift issues in JavaScriptEventLoop Fix some Embedded Swift issues in JavaScriptEventLoop Apr 16, 2025
}
}

/// Wait for the promise to complete, returning its result or exception as a Result.
///
/// - Note: Calling this function does not switch from the caller's isolation domain.
public func value(isolation: isolated (any Actor)? = #isolation) async throws -> JSValue {
try await withUnsafeThrowingContinuation(isolation: isolation) { [self] continuation in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a typed-throws version of withContinuation 😔

@kateinoigakukun kateinoigakukun merged commit d3b26d3 into main Apr 16, 2025
6 checks passed
@kateinoigakukun kateinoigakukun deleted the maxd/embedded-concurrency1 branch April 16, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants