Standard builtins' prototypes and toString

André Bargull andre.bargull at udo.edu
Thu Jun 12 10:32:01 PDT 2014


> On Thu, Jun 12, 2014 at 12:48 PM, Jason Orendorff
> <jorendorff at mozilla.com  <https://mail.mozilla.org/listinfo/es-discuss>> wrote:
> >/  In any case, I doubt we have a choice. ES3-5 at least supported it. There is
> />/  surely a Web page somewhere that calls .toString() on every object it can
> />/  find, just because.
> /

Or a web page converts some value to a string using `"" + someValue`, in 
which case adding a toString() legacy mode is not sufficient, because 
valueOf() is actually invoked (well, except for Date.prototype because 
of its @@toPrimitive override). Does that mean valueOf() also needs to 
have a legacy mode to special case the prototype object?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140612/b2e286e4/attachment.html>


More information about the es-discuss mailing list