You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are a Cursed Object in the WebIDL spec (https://webidl.spec.whatwg.org/#idl-callback-interfaces), and they’re essentially shorthand for a union between a function/closure type and an object with a property matching that function type. They are unfortunately important because EventListener is a callback interface (although NodeFilter and XPathNSResolver are also a callback interface, they are less commonly used). This PR depends on #32, probably.
Update: Implemented EventListener in 61144ad by interpreting it as a simple closure (EventTarget) -> Void. This does technically mean you can’t pass an object as an event listener but I’ve never heard of anyone wanting to do that.
The other two callback interfaces are available as properties/method return values (EventListener is currently only used in the spec as a parameter), so it’s possible to get one of the object-y versions which could not be converted directly to a closure.
These are a Cursed Object in the WebIDL spec (https://webidl.spec.whatwg.org/#idl-callback-interfaces), and they’re essentially shorthand for a union between a function/closure type and an object with a property matching that function type. They are unfortunately important because
EventListener
is a callback interface (althoughNodeFilter
andXPathNSResolver
are also a callback interface, they are less commonly used). This PR depends on #32, probably.https://github.com/swiftwasm/DOMKit/blob/070f99efca195eaa38f46beeb4dc46ca1d6ce04b/Sources/WebIDLToSwift/IDLBuilder.swift#L82-L88
The text was updated successfully, but these errors were encountered: