Closed medikoo closed 7 years ago
I'm not sure what you mean. The whole point is that we don't want a global cross-realm communications channel - the Symbol registry works because it's primitives, so you can't transmit any information that way.
Either way, this would be a totally unrelated and separate proposal, so this repo isn't the place to discuss it.
Technically in browser environments you have a global cross-realm communication, e.g. you can deal with objects created in other realm (another frame)
And in case of Symbol
, it's a GlobalSymbolRegistry
map of primitives (so an object) that it's shared and accessed across realms.
I thought that this use case can happen in user-land for some other functionalities
It's a map but can only contain primitive keys and values, and can't communicate whether a key is present or not.
Wouldn't it be wise to also specify some way for cross-realm global properties handling.
e.g. it's already provided internally for
Symbol.for
andSymbol.keyFor
.In that case I think we can't expose any object, but rather three map-like methods
get
,set
,has
, that will work strictly with strings or symbols as key values.