Claus Reinke wrote:
Object.freeze deals in certain observables. It does not freeze closure state, or weakmap-encoded state, or (per the ES6 proposal) private-symbol-named property state where such properties already exist. Those are not directly observable by the reflection API.

True, private symbols as first-class objects can hide anywhere.


...

Your -- as in You the abstraction implementor -- may indeed make such state observable.

But if I do not have a way to hook into freeze, etc, how do I make
my objects with hidden state behave like objects with exposed state?

You don't, for a non-proxy. For a proxy, you can do what you like via the whitelist and unknownPrivateSymbol (or better, if there's a better way to handle whitelist misses).

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to