-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add iterable support for webidl #514
Comments
To add @fitzgen part of me things The alternative is implement all the functions that iterables support in webidl like: Oddly with the latest I managed to get the code spitting out a Does this need a RFC? |
Interesting! I think I'd personally be on board with the strategy of using Returns from functions should support For now I think it's ok to avoid an RFC, we're still in the somewhat early stages of web-sys! |
I don't think Instead I think the best course of action is to return |
Oh sure yes, if it's got an actual type (like |
Where I may put in a preliminary PR in with item and some of the other bits so then I can concentrate on the iterator here. |
Ok sounds good to me, I can certainly help debug failures in a PR :) |
see also #776 |
I'm playing with The This iterable behavior isn't necessary for I'm going to have a dig through the codegen to see if its possible to generate js_sys::Iterator (or related) for iterables. |
Ok so I've looked at the code and noticed that I seem to be starting from a blank slate. My implementation plan is
How do you feel about this approach generally? |
That sounds like a good approach to me! |
Fixed by #3962. |
In web-sys to get a functional DOM implementation
iterable<Node?>
is needed byNodeList
.https://heycam.github.io/webidl/#dfn-iterable-declaration which is supported by
webidl::ast::Iterable
.pub fn get_elements_by_name(&self, element_name: &str) -> NodeList
The text was updated successfully, but these errors were encountered: