Re: [heycam/webidl] Return type on identifier-less named/indexed setter is pointless (#523)

There's a few aspects of the current indexed getter/setter/creator triad that confuse me, yeah. This could strongly benefit from some more guidance in the spec about how to do things idiomatically.

In <https://github.com/w3c/css-houdini-drafts/issues/664> you explain some of the subtleties, which is great.  In particular, that if the indexed getter/setter is unnamed, the `foo[5]` will never be called at all if `5` isn't a supported index, so the *type* of the getter/setter can just be the type I actually want to be return (that is, it doesn't need to be nullable if the plain value isn't intended to be nullable).

One thing I'm not sure about yet is how to handle indexed creation.  In my current text I'm planning on allowing an indexed creator to set only `foo[foo.length]` - you can directly increase the length of an array-like, but not create holes.  As you say in the linked issue, there's no longer a way to define a deleter for indexed properties, so you can't create holes that way.

-- 
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/523#issuecomment-366395286

Received on Saturday, 17 February 2018 00:15:43 UTC