We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b7fda0 commit c68679aCopy full SHA for c68679a
Sources/JavaScriptKit/FundamentalObjects/JSObject.swift
@@ -206,12 +206,14 @@ public class JSObject: Equatable {
206
/// This allows access to the global properties and global names by accessing the `JSObject` returned.
207
public static var global: JSObject { return _global }
208
209
- // `JSObject` storage itself is immutable, and use of `JSObject.global` from other
210
- // threads maintains the same semantics as `globalThis` in JavaScript.
+ #if compiler(>=5.10)
211
@LazyThreadLocal(initialize: {
212
return JSObject(id: _JS_Predef_Value_Global)
213
})
214
private static var _global: JSObject
+ #else
215
+ private static let _global = JSObject(id: _JS_Predef_Value_Global)
216
+ #endif
217
218
deinit {
219
assertOnOwnerThread(hint: "deinitializing")
0 commit comments