Closed j-f1 closed 1 year ago
Setter merging implemented in 7dc16029001f738dd1c477e222febb56e0e7f1ed. (made extra fun by spec authors not putting the getter/setter methods adjacent to each other!)
Deleters implemented in 144bf2fe4870576b54d7638e2f94ee65d66b0071.
Subscript getters/setters are represented as separate nodes in WebIDL, so we’ll need to do a step to merge them before attempting to print them (since Swift requires that the getter and setter for a subscript be colocated)
https://github.com/swiftwasm/DOMKit/blob/45ed26d277a73ff09fc79fd39d6f59fce39fdffd/Sources/WebIDLToSwift/WebIDL%2BSwiftRepresentation.swift#L370-L381
For a related example, see
AsyncOperation
, which wraps a singleIDLOperation
to emit both aJSPromise
-returning and anasync
version of the method.Also, support for deleters should be added. Swift doesn’t have a concept of a deleter, so I guess the best approach would be to define a
removeValue(forKey:)
method, just likeDictionary
?