tc39 / test262

Official ECMAScript Conformance Test Suite
Other
2.37k stars 462 forks source link

Missing tests for map and set treatment of NaN flavors #3454

Open gibson042 opened 2 years ago

gibson042 commented 2 years ago

Discovered by an XS bug: https://github.com/Moddable-OpenSource/moddable/issues/888

Maps and sets should not differentiate NaN values, such as those from NaN vs. Number("x") vs. Math.sqrt(-1) vs. Infinity * 0.

linusg commented 2 years ago

We've had literally the same bug in LibJS (discovered after seeing the XS bug): https://github.com/SerenityOS/serenity/pull/13438 - so +1 for adding some tests for it.

bathos commented 2 years ago

@gibson042 I’m thrilled to hear this should be the case. I couldn’t find anywhere in the spec that seemed to mandate this, though. If it is already specified that this is required, perhaps you would be able to answer this question.

[Edit]: realized that the XS bug is about something a bit different: get/has/set not following SameValueZero, not whether or not the side channel exists at all, so maybe this is not the news I’d hoped for.