Re: [heycam/webidl] Add dedicated IDL syntax for indexed property getters (#584)

Not  all indexed getters are named "item" (some are anonymous, some are getItem).  So the desugaring would need to be parametrized on more things.

There's a tradeoff here between spec authoring and spec reading.  We _could_ add a requirement that any time you have an indexed getter and length you need to include some other syntactic construct which makes it clear you're iterable.  But since most spec authors don't run their IDL through any IDL-validity tooling, afaict, it would be easy to forget this construct and end up with invalid IDL.

For extra confusion, you can already add `iterable<Attr>` to something like `NamedNodeMap`.  It doesn't change what happens with `@@iterator` but does expose more methods like `entries`, `forEach`, `keys`, `values`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/584#issuecomment-424767568

Received on Wednesday, 26 September 2018 16:00:42 UTC