Standard builtins' prototypes and toString
Allen Wirfs-Brock
allen at wirfs-brock.com
Thu Jun 12 08:57:46 PDT 2014
On Jun 12, 2014, at 8:45 AM, André Bargull wrote:
>> On Jun 12, 2014, at 5:26 AM, Till Schneidereit wrote:
>>
>> > While working on changing Date.prototype to be a plain object in SpiderMonkey, we realized that there's an issue: the way things are specced now, `alert(Date.prototype)` will throw, because `Date.prototype.toString` isn't generic. The same applies for all builtins with non-generic `toString` prototype functions.
>>
>> Fortunately there aren't very many of those. I think it is only Date and RegExp that have this issue among the ES6 built-ins
>
> And Number.prototype, String.prototype, Boolean.prototype and Symbol.prototype. And actually it's even worse for Symbol.prototype because of the @@toPrimitive override.
Right, I left those out because I thought we didn't have an issue with them, but you're right. I'll fix them too.
Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140612/bee58568/attachment-0001.html>
More information about the es-discuss
mailing list