We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Sendable
JSValue
1 parent 18ad4e3 commit 3f3b494Copy full SHA for 3f3b494
Sources/JavaScriptKit/JSValue.swift
@@ -100,6 +100,13 @@ public enum JSValue: Equatable {
100
}
101
102
103
+/// JSValue is intentionally not `Sendable` because accessing a JSValue living in a different
104
+/// thread is invalid. Although there are some cases where Swift allows sending a non-Sendable
105
+/// values to other isolation domains, not conforming `Sendable` is still useful to prevent
106
+/// accidental misuse.
107
+@available(*, unavailable)
108
+extension JSValue: Sendable {}
109
+
110
public extension JSValue {
111
#if !hasFeature(Embedded)
112
/// An unsafe convenience method of `JSObject.subscript(_ name: String) -> ((ConvertibleToJSValue...) -> JSValue)?`
0 commit comments