[Webkit-unassigned] [Bug 70889] New: Result of Error.prototype.toString not ES5 conform

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 26 02:06:32 PDT 2011


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

           Summary: Result of Error.prototype.toString not ES5 conform
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mstarzinger at chromium.org


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";
}

-- 
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