Default @@toStringTag for user classes

Michał Wadas michalwadas at gmail.com
Tue Dec 2 09:45:04 PST 2014


The difference between "[Object Point]" and "[Object Set]" is fundamental.
Your application would not change any behavior without explicit creating
"new Set".
But changing behavior of existing code is something different - it can
introduce subtle bugs in enclosed environment.
2 gru 2014 13:03 "Claude Pache" <claude.pache at gmail.com> napisał(a):

>
> Le 2 déc. 2014 à 09:04, Michał Wadas <michalwadas at gmail.com> a écrit :
>
> It probably would be backward incompatible change. Too much code depends
> on [Object Object].
>
> I'm curious to know what sort of code would be broken by
> `O.p.toString.call(x) === "[object Point]"` for instances `x` of some
> user-defined class? and whether it is not already broken by, say,
> `O.p.toString.call(new Set) === "[object Set]"`?
>
> —Claude
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141202/ef4becaf/attachment.html>


More information about the es-discuss mailing list