Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 2ce1d76

Browse files
TizianoCoroneocalvincestari
authored andcommitted
[v1.0.0 Alpha 1] JavascriptError @unchecked Sendable (apollographql#2147)
* fix: added unchecked sendable to JavascriptError to be able to compile with Swift 5.6 * Update CircleCI to use latest images * Change JavaScriptError properties to read-only * Fix typo in header doc Co-authored-by: TizianoCoroneo <tizianocoroneo@me.com> Co-authored-by: Calvin Cestari <calvin.cestari@gmail.com>
1 parent a89b66b commit 2ce1d76

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ version: 2.1
33
parameters:
44
xcode_version:
55
type: string
6-
default: "13.0.0"
6+
default: "13.2.1"
77
ios_current_version:
88
type: string
9-
default: "15.0"
9+
default: "15.2"
1010
ios_previous_version:
1111
type: string
1212
default: "14.5"
1313
ios_sdk:
1414
type: string
15-
default: "iphonesimulator15.0"
15+
default: "iphonesimulator15.2"
1616
macos_version: # The user-facing version string for macOS builds
1717
type: string
18-
default: "11.5.2"
18+
default: "11.6.2"
1919
macos_sdk: # The full SDK string to use for macOS builds
2020
type: string
21-
default: "macosx11.3"
21+
default: "macosx12.1"
2222
tvos_version: # The user-facing version string of tvOS builds
2323
type: string
24-
default: "15.0"
24+
default: "15.2"
2525
tvos_sdk:
2626
type: string
27-
default: "appletvsimulator15.0"
27+
default: "appletvsimulator15.2"
2828

2929
commands:
3030
integration_test_setup:

Sources/ApolloCodegenLib/Frontend/JavaScriptBridge.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import JavaScriptCore
44
// and can be safely force unwrapped. (Even when an exception is thrown they would still return
55
// a `JSValue` representing a JavaScript `undefined` value.)
66

7-
/// An errror thrown during JavaScript execution.
7+
/// An error thrown during JavaScript execution.
88
/// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
9-
public class JavaScriptError: JavaScriptObject, Error {
10-
lazy var name: String? = self["name"]
11-
12-
lazy var message: String? = self["message"]
13-
14-
lazy var stack: String? = self["stack"]
9+
public class JavaScriptError: JavaScriptObject, Error, @unchecked Sendable {
10+
// These properties were changed to read-only when `@unchecked Sendable` was added for
11+
// Xcode 13.3. If you make them publicly writable or alter their values within the class
12+
// you will need to do so with thread-safety in mind.
13+
var name: String? { self["name"] }
14+
var message: String? { self["message"] }
15+
var stack: String? { self["stack"] }
1516
}
1617

1718
extension JavaScriptError: CustomStringConvertible {

0 commit comments

Comments
 (0)