defineProperty invariants

David Bruant bruant.d at gmail.com
Fri Oct 5 09:39:41 PDT 2012


Le 05/10/2012 15:05, Tom Van Cutsem a écrit :
> 2012/10/4 David Bruant <bruant.d at gmail.com <mailto:bruant.d at gmail.com>>
>  
>
>     I think the invariant should be:
>     ToBoolean(definePropertyTrapOutput) === true
>     => (descArgument.configurable === targetDesc.configurable)
>
>
> I would formulate it as:
> ToBoolean(definePropertyTrapOutput) === true &&
> descArgument.configurable === false => targetDesc !== undefined &&
> targetDesc.configurable === false
>
> (in words: if Object.defineProperty succeeds for a non-configurable
> property, then the property must exist on the target and also be
> non-configurable)
Your invariant is more accurate indeed.

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


More information about the es-discuss mailing list