Update to JavaScriptKit 0.9, add Global helpers#3
Conversation
| } | ||
|
|
||
| public func arrayBuffer() -> Promise<ArrayBuffer> { | ||
| public func arrayBuffer() -> JSPromise<ArrayBuffer, JSError> { |
There was a problem hiding this comment.
Can you make this change in webidl2swift and re-run it to regenerate these files?
There was a problem hiding this comment.
Can fix this in webidl2swift, but I'm not sure if we can rely on it long-term. It's great to provide initial scaffolding, but there's also some generated junk to clean up and manual handling of JSClosure is still required. I've done some of that manual work in #4.
There was a problem hiding this comment.
webidl2swift changes are now available for review in Apodini/webidl2swift#10.
| public extension Document { | ||
| var body: HTMLElement { | ||
| .init(unsafelyWrapping: jsObject.body.object!) | ||
| } | ||
| } |
There was a problem hiding this comment.
This is defined as a property on the Document object by the spec (https://html.spec.whatwg.org/#the-document-object:dom-document-body) but the dom.webidl doesn’t reference it so it isn’t properly generated. I mentioned parsing the HTML spec as a stumbling block earlier but may give it a go.
# Conflicts: # Tests/DOMKitTests/DOMKitTests.swift
Updates JavaScriptKit dependency to upstream 0.9 instead of using a fork as previously. I've updated a few helpers to use non-deprecated names and also added
Globaltype andpublic let global = Global()with a few extensions on DOM types which for some reason don't seem to be declared in WebIDL.Additional
DOMKitDemotarget and product are set up for easy manual test.