Language design

Boris Zbarsky bzbarsky at
Sat Jun 13 05:12:47 UTC 2015

On 6/12/15 8:21 PM, KOLANICH wrote:
> No. I really think that -0 === +0 also should be false, because they are
> different objects. So should be 0=="0". I don't think it will break a
> lot of code

Theory is great, but experiment is better.

With that in mind, I have created a build of Firefox 38 that you can try 
that has just your proposed modification for ==: test false when one 
side is a string and the other is a number.  Making -0 === +0 test false 
would take more effort than I'm willing to put in right now, since the 
JITs actually optimize that path, unlike the other one, and I'd have to 
change the actual low-level assembly used in a pretty nontrivial (e.g. 
ucomisd treats 0 and -0 as equal so I'd need to add manual tests for 0 
vs -0).

In any case, you can try this build out and report back on whether you 
find any problems on websites.

You can download the test builds at one of the following links, 
depending on which one you want:

The Mac build is still in progress, but should appear in 
in a few hours I expect.


P.S.  I've encountered at least one site in the past week that relied on 
string vs number == just triaging bug reports.  So I'm not too hopeful 
about your chances of avoiding problems with this build, but I figure 
you should give it a shot at least.

More information about the es-discuss mailing list