Le 16/06/2011 15:26, David Bruant a écrit :
Le 16/06/2011 15:15, Sean Eagan a écrit :
Sorry, I meant remove the configurability check of the
"getOwnPropertyDescriptor" and "getPropertyDescriptor" trap return
values, and add a check as to whether the "defineProperty" trap return
value is an object to fix the property to.

On Thu, Jun 16, 2011 at 8:12 AM, Sean Eagan<[email protected]> wrote:
How about *optional* property fixing as a compromise?  We could
replace the configurability check of the "defineProperty" trap return
value with a check of whether the return value is an object, in which
case it would be treated as a property descriptor to fix the property
to, otherwise the return value would just be ignored.
If you replace the compulsory configurability check with an opt-in (by choosing a particular return value to defineProperty trap), then "optional property fixing" means "no property fixing", because the optional part could be implemented as a library on top of proxies without configurability check.
...
And it doesn't solve the bicephality issue. One thing that proxies allow is inter-property intelligence. That's why they allow emulation of the relationship between "length" and numeric properties in arrays. Arrays have a unity (what I called "one brain") at the object scale. Any attempt we make to separate properties to a different brain will break this unity. We can partially recover (by putting pieces of the first brain at the property scale of the second one), but it's at the cost of imposing non-configurable properties to be accessor properties (which, this time, is not an invariant imposed by ES5).

The fixed property proposal (even if optional) currently imposes to choose between no inter-property intelligence (non-configurable accessor properties) and non-configurable property being accessors (we loose some inter-property intelligence in that case anyway).

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

Reply via email to