On Thu, Jun 12, 2014 at 12:48 PM, Jason Orendorff <[email protected]> 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.
If you are concerned about compatibility, them `Date.prototype.toString()` should return "Invalid Date" (as Erik stated, in concrete pseudo-code, above), not the result of `Object.prototype.toString()`. Similarly, `Boolean.prototype.toString()` should return `false`, etc. If we're changing the result of `#toString`, then we should just throw a `TypeError`, rather than return some arbitrary value. Specifically, I want `Date#toString` to consistently throw a `TypeError` if `this` is not a `Date` (or subclass), not to do some weird special case only for `Date.prototype`. --scott _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

