[Webkit-unassigned] [Bug 6601] valueOf confuses JSC when run through KDE shouldThrow test

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 6 23:07:51 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=6601


Gavin Barraclough <barraclough at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID
                 CC|                            |barraclough at apple.com




--- Comment #3 from Gavin Barraclough <barraclough at apple.com>  2011-09-06 23:07:51 PST ---
This test case is invalid, and correctly fails (it fails in firefox, too).

The problem is that the test adds a valueOf method to the Object prototype.  The test (that an error is thrown) then passes (an error is thrown when Date.prototype.valueOf is applied to a vanilla object).

The test harness then tries to format up an error message indicating the test passed, using the following line:
    testPassed(_a + " threw exception " + exception + ".");
This will call ToPrimitive with the numeric hint on exception, which will favor calling the valueOf operator on the object.  Since TypeError derive from object, and the object prototype still has the date prototypes valueOf, the ToPrimitive conversion will correctly throw an error.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list