Symbols, Protocols, Frames, and Versioning
brendan at mozilla.com
Thu Oct 4 08:27:17 PDT 2012
Tom Van Cutsem wrote:
> 2012/10/4 Brendan Eich <brendan at mozilla.org <mailto:brendan at mozilla.org>>
> I don't think we've had a proposal yet for singleton modules per
> set of connected realms. Possibly I missed it (something is
> tickling a memory but I can't find a ref). It could be good!
> This might have been the post that tickled your memory:
> But this was about singleton module instances per loader context. Not
> sure if "loader context" coincides with "set of connected realms" though.
AFAIK there's no facility for loading or finding already loaded a
singleton module per connected set of realms.
If there were, it could be good for public symbol usage cross-realm as
Kevin points out. It could also make a nasty channel among realms (IIRC
the navigator object in some browsers can act like that, or perhaps only
within a navigation history of one realm with multiple inner window
objects and one WindowProxy public global).
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?
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss