Kevin Smith wrote:
Dave Herman mentioned another idea: intern'ing strings as symbols.
You'd lose uniqueness but avoid colliding with any string. So
public @iterator = Symbol.intern('iterator');
Is this much better than just using 'iterator' or dunder-iterator?
Apologies, but what would interning a string as a symbol mean?
Different frames could load a module that does this and the symbol would
be interned as a singleton in all connected realms.
The rendezvous would be on the name, so of course collisions are
possible. Symbol.intern('org.ecma-international.es6.iterator') -- blech!
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss