ES5: typo in Error.prototype.toString()

Michael Day mikeday at yeslogic.com
Wed Aug 4 01:27:53 PDT 2010


Hi,

In ES5 "15.11.4.4 Error.prototype.toString()" states:

     6. If msg is undefined, then let R be msg.

I'm pretty sure that should say:

     6. If msg is undefined, then let R be name.

ie. if an Error object does not have a message property, then toString() 
will return the value of the name property, or "Error" if it doesn't 
have a name property either. This is what Mozilla currently does.

Cheers,

Michael

-- 
Print XML with Prince!
http://www.princexml.com


More information about the es-discuss mailing list