Standard builtins' prototypes and toString

André Bargull andre.bargull at
Thu Jun 12 08:45:17 PDT 2014

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

- André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list