Backstory/rationale for disallowing -0 in Map keys and Sets?

Jordan Harband ljharb at gmail.com
Thu Oct 11 02:21:17 UTC 2018


The unfortunate result, however, is that a subclass that is *more*
restrictive than the base class is not possible to write robustly - namely,
if someone does `Set.prototype.add.call`, they'll bypass any of the
criteria you've set up in the subclass.

I would have vastly preferred that the base class for both Map and Set used
SameValue, and I'd have found a "SameValueZero" subclass to be much more
trivial to write robustly than a "SameValue" subclass is now. That ship,
unfortunately, has long since sailed.

On Wed, Oct 10, 2018 at 11:09 AM T.J. Crowder <
tj.crowder at farsightsoftware.com> wrote:

> On Wed, Oct 10, 2018 at 7:03 PM Allen Wirfs-Brock
> <allen at wirfs-brock.com> wrote:
> > Yes, exactly.
>
> Thanks!
>
> -- T.J. Crowder
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20181010/b6a50267/attachment.html>


More information about the es-discuss mailing list