File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Sources/JavaScriptKit/FundamentalObjects Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,15 @@ public class JSObject: Equatable {
137
137
138
138
/// A `JSObject` of the global scope object.
139
139
/// This allows access to the global properties and global names by accessing the `JSObject` returned.
140
- public static let global = JSObject ( id: _JS_Predef_Value_Global)
140
+ public static var global : JSObject { return _global }
141
+
142
+ // `JSObject` storage itself is immutable, and use of `JSObject.global` from other
143
+ // threads maintains the same semantics as `globalThis` in JavaScript.
144
+ nonisolated ( unsafe)
145
+ static let _global = JSObject ( id: _JS_Predef_Value_Global)
146
+ #else
147
+ static let _global = JSObject ( id: _JS_Predef_Value_Global)
148
+ #endif
141
149
142
150
deinit { swjs_release ( id) }
143
151
You can’t perform that action at this time.
0 commit comments