possible excessive proxy invariants for Object.keys/etc??

Kevin Reid kpreid at google.com
Wed Nov 21 12:51:58 PST 2012

On Wed, Nov 21, 2012 at 12:42 PM, Tom Van Cutsem <tomvc.be at gmail.com> 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.  [...]
> [...]
> 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.

Why can't an implementation cache the knowledge that an object is frozen
(after Object.freeze or after a full pattern-check) exactly as if the
fourth state exists, and get the efficiency benefit (but not the
observability-of-the-test-on-a-proxy benefit) without changing the ES5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121121/6de299cf/attachment-0001.html>

More information about the es-discuss mailing list