Bug 70889

Summary: Result of Error.prototype.toString not ES5 conformant
Product: WebKit Reporter: mstarzinger
Component: JavaScriptCoreAssignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fix, needs testing, test case, Changelog.
none
Fix oliver: review+

mstarzinger
Reported 2011-10-26 02:06:32 PDT
The string representation of Error objects having their 'name' property set to the empty string is incorrect according to the ES5.1 spec. The built-in toString() method should just return the 'message' property for these cases. This is tested by a Test262 test case (i.e. 15.11.4.4-8-1) and can also be reproduced with the following JavaScript snippet. function test() { var err = new Error("The description message"); err.name = ""; return err.toString() === "The description message"; }
Attachments
Fix, needs testing, test case, Changelog. (4.20 KB, patch)
2011-10-26 22:36 PDT, Gavin Barraclough
no flags
Fix (7.81 KB, patch)
2011-11-15 11:57 PST, Gavin Barraclough
oliver: review+
Gavin Barraclough
Comment 1 2011-10-26 22:36:33 PDT
Created attachment 112640 [details] Fix, needs testing, test case, Changelog.
Gavin Barraclough
Comment 2 2011-10-26 22:41:21 PDT
(ooops, ignore the config change!)
Gavin Barraclough
Comment 3 2011-11-15 11:57:38 PST
Gavin Barraclough
Comment 4 2011-11-15 12:35:24 PST
Fixed in r100310
Note You need to log in before you can comment on or make changes to this bug.