archives

« Bugzilla Issues Index

#3066 — Symbol equality bug - 7.2.10 step 8 has no effect


Discovered by Jeff Walden in <https://bugzilla.mozilla.org/show_bug.cgi?id=1042602>.

The notes to draft rev 26 say:

> Updated Symbol conversions: aSym == “not a symbol” produces false. var s=Symbol(); s==Object(s) produces true. [...]

But s==Object(s) evaluates to false according to 7.2.10 <http://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-equality-comparison>. We reach the newly added step 8:

> If Type(x) is Symbol or Type(y) is Symbol, return false.

and at that point we return false. Curiously, the new step has no effect on the algorithm, since we would have ended up returning false at the last step anyway.


Also see Bug 3016

Right the update to 72.10 to make s==Object(s) produce true was wrong.

The new step 8 is unnecessary and steps 10&11 should include Symbol along with String and Number as triggering a ToPrimitive call.

Fixed in rev27 editor's draft


fixed in rev27 draft