Standard builtins' prototypes and toString
Allen Wirfs-Brock
allen at wirfs-brock.com
Wed Jun 18 15:25:51 PDT 2014
On Jun 18, 2014, at 2:38 PM, Brendan Eich wrote:
>
>
>> For example, what should Symbol.prototype.toString() do? (b) sounds like a good choice for it. (c) is certainly ok, for Date.prototype but but we have other cases that need to be addressed.
>
> Symbol.prototype could even throw, it's such an outlier. Throw if no "zero" might go a long way, cover most of the dog.
The spec. current says throw for this Symbol.prototype case. The (reasonable) opposing view is that toString should never throw. Other than the protoype-is-not-an-instance it all about unlikely edge cases where toString methods are applied to the wrong kind of object.
Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140618/6ce403d3/attachment.html>
More information about the es-discuss
mailing list