Re: Default @@toStringTag for user classes

2014-12-02 Thread Michał Wadas
It probably would be backward incompatible change. Too much code depends on [Object Object]. 2 gru 2014 08:46 Dmitry Soshnikov dmitry.soshni...@gmail.com napisał(a): Hi, Probably worth providing a default implementation of the `@@toStringTag` when evaluating a class [1]. In this case users

Re: Default @@toStringTag for user classes

2014-12-02 Thread Claude Pache
Le 2 déc. 2014 à 09:04, Michał Wadas michalwa...@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

Re: Default @@toStringTag for user classes

2014-12-02 Thread Andrea Giammarchi
Same question here. AFAIK usually the `({}.toString.call(generic) === [object Object])` check is the `default:` in a switch, the last `else` in a flow, etc etc ... although I wouldn't be surprised if some code, somewhere, would do strict comparison to know if it's a user defined object or not. In

Re: Default @@toStringTag for user classes

2014-12-02 Thread Claude Pache
Le 2 déc. 2014 à 08:46, Dmitry Soshnikov dmitry.soshni...@gmail.com a écrit : Hi, Probably worth providing a default implementation of the `@@toStringTag` when evaluating a class [1]. In this case users will be able to do: ``` class Point { ... } var p = new Point(1, 2);

Re: Default @@toStringTag for user classes

2014-12-02 Thread Michał Wadas
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

Re: Default @@toStringTag for user classes

2014-12-02 Thread Andrea Giammarchi
I think by `@@toStringTag` he meant the ability to define a `[[Class]]` name so that `{}.toString.call(generic)` would return such name instead of `Object` but I'm sure Dmitry will come back explaining and/or asking more. On Tue, Dec 2, 2014 at 4:49 PM, Claude Pache claude.pa...@gmail.com wrote:

RE: Default @@toStringTag for user classes

2014-12-02 Thread Domenic Denicola
From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Andrea Giammarchi I think by `@@toStringTag` he meant the ability to define a `[[Class]]` name so that `{}.toString.call(generic)` would return such name instead of `Object` but I'm sure Dmitry will come back explaining

RE: Default @@toStringTag for user classes

2014-12-02 Thread Domenic Denicola
From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Michal Wadas But changing behavior of existing code is something different - it can introduce subtle bugs in enclosed environment. Nobody is proposing changing the behavior of existing code. They are proposing changing

Re: Default @@toStringTag for user classes

2014-12-02 Thread Dmitry Soshnikov
On Tue, Dec 2, 2014 at 9:56 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I think by `@@toStringTag` he meant the ability to define a `[[Class]]` name so that `{}.toString.call(generic)` would return such name instead of `Object` but I'm sure Dmitry will come back explaining and/or

Re: Default @@toStringTag for user classes

2014-12-02 Thread Dmitry Soshnikov
On Tue, Dec 2, 2014 at 5:12 PM, Dmitry Soshnikov dmitry.soshni...@gmail.com wrote: On Tue, Dec 2, 2014 at 9:56 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I think by `@@toStringTag` he meant the ability to define a `[[Class]]` name so that `{}.toString.call(generic)` would