Correct. The registry is only accessed via `Symbol.for(key)` and 
`Symbol.keyFor(sym)`. The parameter of `Symbol()` is a description, not a key.



> On 22 Jan 2015, at 01:36, Cyrus Najmabadi <cyr...@microsoft.com> wrote:
> 
> Hi,
>  
> I am reading the Symbol section of the ES6 spec (19.4), and my understanding 
> is that calling the Symbol constructor does *not* add an entry to the 
> GlobalSymbolRegistry. Is that correct?
>  
> For example:
> var s1 = Symbol(“foo”);
> var s2 = Symbol.for(“foo”);
>  
> In this example, s1 and s2 would be two distinct symbols. And in the 
> following example:
>  
> var s1 = Symbol(“foo”);
> var s2 = Symbol.keyFor(s1);
>  
> In this example, s2 would be undefined.
>  
> Am I understanding correctly?
>  
> Thanks,
> Jason
>  
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org <mailto:es-discuss@mozilla.org>
> https://mail.mozilla.org/listinfo/es-discuss 
> <https://mail.mozilla.org/listinfo/es-discuss>
-- 
Dr. Axel Rauschmayer
a...@rauschma.de
rauschma.de



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to