This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Gamepad spec might want to be able return sequences which have holes. sequence<optional FooBar> as a return value could be quite readable.
HOLES ARE EVIL. Just use undefined instead?
> HOLES ARE EVIL. Tell that to UA authors, who all produced arrays with holes here. :( But yes, we could just make it undefined; still need IDL syntax for it, ideally.
sequence<optional FooBar> leading to an array which doesn't have holes but just values defined to be undefined would be ok to me.
Olli filed this bug after discussing bug 27549. Right now implementations are mixed on what to do with removed devices in the return value of getGamepads. Firefox returns an array with nulls where they used to be, Chrome returns a GamepadList which does not have the indicies of removed devices as properties (hasOwnProperty returns false for removed indicies), and IE returns a thing that claims to be an Array but also acts the same way (does not have properties for removed indicies). bug 26181 comment 5 describes the behaviors there. I'm okay with changing the spec as long as we can change it to say something that makes sense in terms of web standards, and also isn't incredibly different from current implementations.