File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed
Sources/DOMKit/ECMAScript Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 44
55import JavaScriptKit
66
7- public class Global {
8- public let jsObject = JSObject . global
9- public let document : Document
10-
11- init ( ) {
12- document = Document ( unsafelyWrapping: jsObject. document. object!)
13- }
7+ public extension Window {
8+ public var document : Document { Document ( unsafelyWrapping: jsObject. document. object!) }
149}
1510
1611public extension Document {
@@ -25,7 +20,7 @@ public extension HTMLElement {
2520 }
2621}
2722
28- public let global = Global ( )
23+ public let globalThis = Window ( from : JSObject . global . jsValue ( ) ) !
2924
3025public class ReadableStream : JSBridgedClass {
3126
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import DOMKit
33
44final class DOMKitTests : XCTestCase {
55 func testExample( ) {
6- let document = global . document
6+ let document = globalThis . document
77 let button = document. createElement ( localName: " button " )
88 button. textContent = " Hello, world! "
99 button. addEventListener ( type: " click " ) { event in
You can’t perform that action at this time.
0 commit comments