Summary: | testapi failure: MyObject - 0 should be NaN but instead is 1. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alexey Proskuryakov <ap> | ||||
Component: | JavaScriptCore | Assignee: | Cameron Zwarich (cpst) <zwarich> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | sam, zwarich | ||||
Priority: | P1 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Alexey Proskuryakov
2008-07-16 01:26:38 PDT
*** Bug 18037 has been marked as a duplicate of this bug. *** 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. Created attachment 28007 [details]
Proposed patch
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?
|