[[Extensible]]and Proxies (Was: Proxy.isProxy )

David Bruant david.bruant at labri.fr
Sun Jul 17 15:14:27 PDT 2011


Le 15/07/2011 23:04, Tom Van Cutsem a écrit :
> 2011/7/15 Brendan Eich <brendan at mozilla.com <mailto:brendan at mozilla.com>>
>
>     On Jul 15, 2011, at 12:38 PM, Allen Wirfs-Brock wrote:
>>     BTW,
>>     if http://wiki.ecmascript.org/doku.php?id=strawman:fixed_properties was
>>     extended to support Object.preventExtensions we might not have
>>     anything to argue about except perhaps performance issues. 
>
>     Indeed, that helps quite a bit. Glad to hear it.
>
>     But there may be more power needed in the fix trap, per the above
>     Array-proxy test.
>
>  
> Glad to hear that too. I'll try to extend the FixedHandler with
> support for non-extensibility. David may beat me to it, though ;-)
:-p
I'm only catching up now on this thread. I have indeed started some work
to try to implement an invariant-enforcing implementation of
preventExtension rather than fix+become.
Things that happened can be followed in the "[Harmony Proxies]
LazyReadCopy experiment and invariant checking for [[Extensible]]=false"
thread.
Long story short, I have started an implementation. It's here:
https://github.com/DavidBruant/HarmonyProxyLab/tree/master/NonExtensibleProxies
But I have not tested it or run it, because after re-reading the ES5
invariants, I realized I was making too much work. So now, I'm waiting
for an answer on whether or not property enumeration traps should
maintain an invariant. Also, traps also need to know non-configurable
properties, so, the approach I took (independent non-extensible proxy
maker) does not seem to fit. One implementation should take care of all
invariants at once. It sounds easier this way.
However, the code used to override Object.preventExtensions and
Object.isExtensible can be kept as is (need to be run and tested to make
sure).

> I'll be offline for the next couple of weeks, so this may take a
> while, but it's noted and I'll follow-up on suggestions later.
Time may be short for me for the next week too. If I find some time,
I'll redo an implementation based on yours and will give a follow-up.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110718/6eac11b2/attachment.html>


More information about the es-discuss mailing list