Array.prototype.contains

Mark S. Miller erights at google.com
Sat Nov 3 23:06:27 PDT 2012


On Sat, Nov 3, 2012 at 10:13 PM, Axel Rauschmayer <axel at rauschma.de> wrote:

> (I am still sad we did not fix indexOf, lastIndexOf, and switch when we
> arguably had the chance.)
>
>
> Can you elaborate? We don’t have the chance, any more? Would anything
> break (or did, in tests)?
>

I am not aware of anyone gathering any evidence one way or the other about
what breakage this might cause. So it is not necessarily too late. If
someone does gather actual evidence that the breakage would be small
enough, I could see us reconsider this. But I doubt we would revisit in the
absence of such evidence.



> How about only letting those methods find NaN, while letting them consider
> +0 and -0 equal?
>

In one way, that would be a big improvement on the status quo: such a rule
would still form an equivalence class. (By contrast, === does not form an
equivalence class since it is not reflexive.)

OTOH, it would make for yet a fourth built-in equality-like test. I don't
think the payoff is worth the complexity.


>
> Axel
>
> --
> Dr. Axel Rauschmayer
> axel at rauschma.de
>
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
>
>


-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121103/dcdc40bb/attachment.html>


More information about the es-discuss mailing list