Re: [heycam/webidl] Remove [LegacyArrayClass] (#291)

> What are the specific concerns with using it, other than "makes the spec author feel icky"?

Ask @annevk, he's the one that keeps throwing shade at me whenever I suggest doing that.

> In that case, why not just use Arrays or an Array subclass (ignoring for the moment the lack of easy way to express it in IDL)? I feel like I'm missing something...

A straight Array subclass means you'll return a straight Array from any of the methods that return an array.

> That doesn't necessarily make sense for map, note. If you have a list of Foo objects and call map on it with a function that returns booleans, you get a list of booleans. Whether it makes sense to still represent it by the same list type kinda depends on what operations are defined for your list.

Sure, but we have an easy way to indicate that you want a sequence container capable of holding any value - cast it to an array.  If you're operating on a specialized object, you should play by the specialized object's rules.  That way, you'll still have access to the specialized object's other methods.

> See https://tc39.github.io/ecma262/#sec-array.prototype.filter step 5 and the https://tc39.github.io/ecma262/#sec-arrayspeciescreate rabbit hole.

Oh, I didn't realize that it was subclass-friendly now!  In that case, with some IDL indication, we could just say that the object should advertise itself as its species.  So yeah, we could just do an Array subclass, I guess.

-- 
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/291#issuecomment-283511222

Received on Wednesday, 1 March 2017 23:56:07 UTC