RESOLVED FIXED 20049
testapi failure: MyObject - 0 should be NaN but instead is 1.
https://bugs.webkit.org/show_bug.cgi?id=20049
Summary testapi failure: MyObject - 0 should be NaN but instead is 1.
Alexey Proskuryakov
Reported 2008-07-16 01:26:38 PDT
Testapi is reporting a failure with r35197: __FAIL__: MyObject - 0 should be NaN but instead is 1.
Attachments
Proposed patch (1.30 KB, patch)
2009-02-25 23:56 PST, Cameron Zwarich (cpst)
oliver: review+
Alexey Proskuryakov
Comment 1 2008-07-16 01:27:41 PDT
Cameron Zwarich (cpst)
Comment 2 2008-11-10 12:16:04 PST
*** Bug 18037 has been marked as a duplicate of this bug. ***
Cameron Zwarich (cpst)
Comment 3 2009-02-25 23:48:42 PST
I think the test result here is correct. In the ECMA spec, subtraction uses ToNumber, not ToPrimitive, but the test file says this, where the second test is the failing test: shouldBe("+MyObject", 1); // toNumber ... shouldBe("MyObject - 0", NaN); // toPrimitive Addition uses ToPrimitive, and the result of the equivalent addition test may be wrong, but that's a different question.
Cameron Zwarich (cpst)
Comment 4 2009-02-25 23:56:03 PST
Created attachment 28007 [details] Proposed patch
Oliver Hunt
Comment 5 2009-03-21 19:24:05 PDT
Comment on attachment 28007 [details] Proposed patch r=me, but i'd really like it if we could come up with something that would attempt a toPrimitive conversion -- possibly another custom object?
Cameron Zwarich (cpst)
Comment 6 2009-03-21 20:04:38 PDT
Fixed in r41896. I agree with your comment, Oliver.
Note You need to log in before you can comment on or make changes to this bug.