Skip to content

Commit daa8209

Browse files
Concurrency: Remove Error conformance from JSError
`Error` protocol now requires `Sendable` conformance, which is not possible for `JSError` because `JSObject` is not `Sendable`.
1 parent 2642df9 commit daa8209

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: Sources/JavaScriptKit/BasicObjects/JSError.swift

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22
class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) that
33
exposes its properties in a type-safe way.
44
*/
5-
public final class JSError: Error, JSBridgedClass {
5+
public final class JSError: JSBridgedClass {
66
/// The constructor function used to create new JavaScript `Error` objects.
77
public static var constructor: JSFunction? { _constructor.wrappedValue }
88
private static let _constructor = LazyThreadLocal(initialize: { JSObject.global.Error.function })
99

1010
/// The underlying JavaScript `Error` object.
11-
///
12-
/// NOTE: This property must be accessed from the thread that
13-
/// the thrown `Error` object was created on. Otherwise,
14-
/// it will result in a runtime assertion failure.
15-
public nonisolated(unsafe) let jsObject: JSObject
11+
public let jsObject: JSObject
1612

1713
/// Creates a new instance of the JavaScript `Error` class with a given message.
1814
public init(message: String) {

0 commit comments

Comments
 (0)