Skip to content

Commit c68679a

Browse files
Build fix for Swift 5.9
1 parent 9b7fda0 commit c68679a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/JavaScriptKit/FundamentalObjects/JSObject.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,14 @@ public class JSObject: Equatable {
206206
/// This allows access to the global properties and global names by accessing the `JSObject` returned.
207207
public static var global: JSObject { return _global }
208208

209-
// `JSObject` storage itself is immutable, and use of `JSObject.global` from other
210-
// threads maintains the same semantics as `globalThis` in JavaScript.
209+
#if compiler(>=5.10)
211210
@LazyThreadLocal(initialize: {
212211
return JSObject(id: _JS_Predef_Value_Global)
213212
})
214213
private static var _global: JSObject
214+
#else
215+
private static let _global = JSObject(id: _JS_Predef_Value_Global)
216+
#endif
215217

216218
deinit {
217219
assertOnOwnerThread(hint: "deinitializing")

0 commit comments

Comments
 (0)