RESOLVED FIXED 12961
shouldBe() should support NaN
https://bugs.webkit.org/show_bug.cgi?id=12961
Summary shouldBe() should support NaN
Alexey Proskuryakov
Reported 2007-03-04 00:33:36 PST
Currently, JS shouldBe() tests don't work with NaN results, because NaN != NaN. Patch forthcoming.
Attachments
proposed patch (1.18 KB, patch)
2007-03-04 00:35 PST, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2007-03-04 00:35:51 PST
Created attachment 13468 [details] proposed patch
Nikolas Zimmermann
Comment 2 2007-03-04 03:53:54 PST
Looks fine, though what is the "===" operator? (you didn't add it - just wondering though...) - else if (_av === _bv) + else if (_av === _bv || (typeof(_av) == "number" && typeof(_bv) == "number" && isNaN(_av) && isNaN(_bv))) Niko
David Kilzer (:ddkilzer)
Comment 3 2007-03-04 07:05:44 PST
(In reply to comment #2) > Looks fine, though what is the "===" operator? (you didn't add it - just > wondering though...) It's the identity (strict equality) operator. There is also a "not identity" operator: !== http://www.webreference.com/js/tips/991205.html
Darin Adler
Comment 4 2007-03-04 21:56:00 PST
Comment on attachment 13468 [details] proposed patch r=me
Alexey Proskuryakov
Comment 5 2007-03-04 22:31:54 PST
Committed revision 19959.
Note You need to log in before you can comment on or make changes to this bug.