You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the issue. I thought about it. But someone could use Symbol.for('observable') for anything else and it will unexpectedly make objects with this property observable. However, sure, it could be solved by using something like prefixes. Also, it will not work with polyfilled Symbol - the proper cross-realm Symbol.for behavior can't be polyfilled, so we could forget about, for example, IE11 - that was the main reason why it's still not added.
zloirock
changed the title
Don't use WellKnownSymbolsStore for Symbol.observable if when Symbol.for is available
Cross-realm well-known symbols
Oct 21, 2021
WellKnownSymbolsStore
is not shared across realms, butSymbol.for
is shared:https://jakearchibald.com/2017/arrays-symbols-realms/
Reproduction:
Symbol.observable
againstSymbol.observable
from the iframe, they won't be equal.On the other hand,
window.Symbol.for('observable') === iframe.window.Symbol.for('observable')
soSymbol.for
works across realms.The text was updated successfully, but these errors were encountered: