Because, to be consistent with Number/String/Boolean you would expect `new 
Symbol()` to create a  Symbol wrapper object.  But we anticipated that if `new 
Symbol` was allowed many devs (who lacked an understanding of the difference 
between primitive values and wrapper objects for primitive values) would code 
`new Symbol()` with the expectation that they were creating a Symbol value. 
This would be a silent bug so we disallowed `new Symbol()`.

. 
> On Aug 14, 2016, at 4:15 PM, Domenic Denicola <[email protected]> wrote:
> 
> Symbol is not a class.
>  
> From: es-discuss [mailto:[email protected]] On Behalf Of 
> /#!/JoePea
> Sent: Sunday, August 14, 2016 18:31
> To: es-discuss <[email protected]>
> Subject: Why ES6 introduced classes yet `Symbol` not to be used with `new`?
>  
> It seems like `new Symbol()` would be inline with the introduction of 
> classes. Why was it chosen not to be constructible? Seems like it would make 
> sense to throw an error on `Symbol()` but not `new Symbol()`. Was it to save 
> three characters of typing?
> 
> /#!/JoePea
> _______________________________________________
> 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

Reply via email to