possible excessive proxy invariants for Object.keys/etc??
allen at wirfs-brock.com
Wed Nov 21 14:42:04 PST 2012
On Nov 21, 2012, at 12:42 PM, Tom Van Cutsem wrote:
> 2012/11/21 Mark S. Miller <erights at google.com>
> On Wed, Nov 21, 2012 at 8:55 AM, Allen Wirfs-Brock
> <allen at wirfs-brock.com> wrote:
> > [...] Essentially we could internally turn the [[Extensible]] internal property into a four state value: open,non-extensible,sealed,frozen. [...]
> First, my apologies for not yet finding the time to catch up on this
> thread. But I did want to encourage this particular idea. We may not
> be able to make this work out, but it would have many benefits if we
> could. For example, the "isFrozen" check in the Object.observe API
> would make more sense if this were a simple state rather than a
> pattern check. More later...
> If JS objects could be in only one of four states, things would be a lot simpler to reason about. That said, I don't see how we can get there without radically breaking with ES5's view of object invariants.
Of course, I don't necessarily agree that ES5 has such a view of object invariants... ;-)
However, everything we currently have in ES5 maps to one of those fours states. Do you actually care very much, form a reasoning perspective, about a open object with some non-configurable properties. Or an non-extensible object with with some configurable properties?
Overall, I think having the four states makes the conceptual model clearer and might guide us in cleaning up the MOP.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss