> As far as the spec is concerned...
>
> Symbols were introduced in draft 12 of ES6.
> They were defined as a kind of exotic object, stateless and immutable.
>
> In draft 15, Symbol became a primitive type.
> In draft 16, it went back to being a kind of exotic object.
> In draft 19, it went back to being a primitive type.
can i ask why they were changed to primitive-type instead of exotic-object?
what are the disadvantages of keeping symbols as objects (with an extra
Object.isSymbol subtype-check)?
because one obvious advantage from what i see, is to avoid breaking
backwards-compatibility with previously stable-code (since es1 in 1997 [1])
that rely on typeof checks:
```js
if (typeof foo === ...) {
...
} else {
// break backwards-compatibility with stable-code since es1
// due to unexpected symbol-case
...
}
```
[1] ECMA-262, 1st edition, June 1997
https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%201st%20edition,%20June%201997.pdf
<https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%201st%20edition,%20June%201997.pdf>
kai zhu
[email protected]
> On 29 May 2018, at 3:33 PM, T.J. Crowder <[email protected]>
> wrote:
>
> Thanks all!
>
> On Mon, May 28, 2018 at 7:36 PM, Michael Dyck <[email protected]
> <mailto:[email protected]>> wrote:
> > As far as the spec is concerned...
>
> Thanks. Sorry Michael, I should have been more clear: I'm talking about the
> history _leading up_ to the spec.
>
> On Mon, May 28, 2018 at 7:33 PM, Allen Wirfs-Brock <[email protected]
> <mailto:[email protected]>> wrote:
> > That's a pretty good summary
>
> On Tue, May 29, 2018 at 2:51 AM, Allen Wirfs-Brock <[email protected]
> <mailto:[email protected]>> wrote:
> > A good starting point for researching the history is:
> > https://web.archive.org/web/20110505015255/http://wiki.ecmascript.org:80/doku.php?id=strawman:private_names
> >
> > <https://web.archive.org/web/20110505015255/http://wiki.ecmascript.org:80/doku.php?id=strawman:private_names>
>
> Thanks Allen. If the summary was good enough, that's as much detail as I need
> to get into.
>
> Thanks again all!
>
> -- T.J. Crowder
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss