Hi, 2012/10/4 David Bruant <[email protected]>
> Hi, > > I think it's the dual of the getOwnPropertyDescriptor invariant I talked > about recently. > Yep. That's exactly it. I'll patch the spec. > 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) > Basically, it says that if the operation succeeded, the new target > descriptor and the descriptor on the target after the trap call are the > same. > With the minor detail that defining a configurable property can succeed without the property having to exist on the target at all. > Do we want invariants regarding when ToBoolean(definePropertyTrapOutput) > is false? > I don't think that is necessary: if the trap returns false, Object.defineProperty will throw anyway. Trying to enforce some invariant would only lead to the same effect. Cheers, Tom
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

