Skip to content
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

[v1.0.0 Alpha 1] JavascriptError @unchecked Sendable #2147

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ version: 2.1
parameters:
xcode_version:
type: string
default: "13.0.0"
default: "13.2.1"
ios_current_version:
type: string
default: "15.0"
default: "15.2"
ios_previous_version:
type: string
default: "14.5"
ios_sdk:
type: string
default: "iphonesimulator15.0"
default: "iphonesimulator15.2"
macos_version: # The user-facing version string for macOS builds
type: string
default: "11.5.2"
default: "11.6.2"
macos_sdk: # The full SDK string to use for macOS builds
type: string
default: "macosx11.3"
default: "macosx12.1"
tvos_version: # The user-facing version string of tvOS builds
type: string
default: "15.0"
default: "15.2"
tvos_sdk:
type: string
default: "appletvsimulator15.0"
default: "appletvsimulator15.2"

commands:
integration_test_setup:
Expand Down
15 changes: 8 additions & 7 deletions Sources/ApolloCodegenLib/Frontend/JavaScriptBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import JavaScriptCore
// and can be safely force unwrapped. (Even when an exception is thrown they would still return
// a `JSValue` representing a JavaScript `undefined` value.)

/// An errror thrown during JavaScript execution.
/// An error thrown during JavaScript execution.
/// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
public class JavaScriptError: JavaScriptObject, Error {
lazy var name: String? = self["name"]

lazy var message: String? = self["message"]

lazy var stack: String? = self["stack"]
public class JavaScriptError: JavaScriptObject, Error, @unchecked Sendable {
// These properties were changed to read-only when `@unchecked Sendable` was added for
// Xcode 13.3. If you make them publicly writable or alter their values within the class
// you will need to do so with thread-safety in mind.
var name: String? { self["name"] }
var message: String? { self["message"] }
var stack: String? { self["stack"] }
}

extension JavaScriptError: CustomStringConvertible {
Expand Down