A case for removing the seal/freeze/isSealed/isFrozen traps
David Bruant
bruant.d at gmail.com
Sat Feb 16 15:29:09 PST 2013
Le 16/02/2013 23:31, Allen Wirfs-Brock a écrit :
>> Will this not just shift the current complexity someplace else?
> Well, it means that for 100% backwards compatibility, Object.isFrozen
> would have to be something like:
>
> 1. Let state = obj.[[GetIntegrity]]();
> 2 If state is "frozen" return true;
> 3 If state is "sealed" or "non-extensible", then return true if all
> properties are non-configurable and non-writable
nit: You can save the state to "frozen" before returning true.
> 4 return false.
>
> The real complexity saving is in simplifying the MOP/Proxy handler
> interface and also in making Proxy invariants only sensitive to the
> explicit integrity state of an object.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130217/f00bf5bb/attachment.html>
More information about the es-discuss
mailing list