Re: WindowProxy as the key in ES6 Set/Map/WeakSet/WeakMap

>> From a use cases perspective, there is one issue: how does one attach
state to a "web page"?
>
>
> That's a slippery notion because sometimes |w| acts like the container
and sometimes it acts like the thing contained.  Sounds like a recipe for
security vulnerabilities when the author and WeakMap disagree about whether
they're talking about the container or the thing contained...

If you want to associate state with a proxy, use a WeakMap.

If you want to attach state to a specific window with all security checks,
install a private symbol on the window itself. (Granted, this does not
exist yet :-)).

Received on Wednesday, 16 April 2014 13:03:03 UTC