Closed Bug 604427 Opened 14 years ago Closed 14 years ago

JM: wrong result for !== when operands have same backing

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jandem, Assigned: jandem)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

JM fails both of these tests:
----
function testNan(x) {
    var a = "f" + x;
    return (a !== a);
}
function testInt(x) {
    var a = x|0;
    return (a !== a);
}
assertEq(testNan(1), false);
assertEq(testInt(10), false);
----
I'll attach a patch to fix this.
Attached patch PatchSplinter Review
That NaN-test from comment 0 is not a NaN-test of course. This patch fixes both cases.
Attachment #483212 - Flags: review?(dvander)
Comment on attachment 483212 [details] [diff] [review]
Patch

Nice catch.
Attachment #483212 - Flags: review?(dvander) → review+
http://hg.mozilla.org/mozilla-central/rev/fecbc58f244c
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: