archives

« Bugzilla Issues Index

#3808 — 9.5: Notes for Proxy internal methods don't mention every enforced invariant


In [9.5.9](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver), the informative note for Proxy [[Set]] mentions only two invariants. However, in [6.1.7.3](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-invariants-of-the-essential-internal-methods), a third invariant (that the return type of the handler must be boolean) is mentioned. The 9.5.9 note should mention this as well.

9.5.4, 9.5.6, 9.5.7 and 9.5.10 have this issue as well, and maybe others.

Also, the 9.5.10 text "A property cannot be deleted, if it exists as a non-configurable own property of the target object." seems only nominally correct: the algorithm itself doesn't prevent properties from being deleted except as a result of calling Ordinary Object [[Delete]].

Also, the 9.5.5 text "The result of [[GetOwnProperty]] can be applied to the target object using [[DefineOwnProperty]] and will not throw an exception." doesn't seem to be an invariant mentioned at all in 6.1.7.3.


foxed in rev33 editor's draft

(In reply to Leon Arnott from comment #0)
> In
> [9.5.9](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-proxy-
> object-internal-methods-and-internal-slots-set-p-v-receiver), the
> informative note for Proxy [[Set]] mentions only two invariants. However, in
> [6.1.7.3](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-
> invariants-of-the-essential-internal-methods), a third invariant (that the
> return type of the handler must be boolean) is mentioned. The 9.5.9 note
> should mention this as well.
>
> 9.5.4, 9.5.6, 9.5.7 and 9.5.10 have this issue as well, and maybe others.

added bullet item about boolean result


>
> Also, the 9.5.10 text "A property cannot be deleted, if it exists as a
> non-configurable own property of the target object." seems only nominally
> correct: the algorithm itself doesn't prevent properties from being deleted
> except as a result of calling Ordinary Object [[Delete]].

changed the text to "...cannot be reported as deleted..." which is what 9.5.10 actually enforces.


>
> Also, the 9.5.5 text "The result of [[GetOwnProperty]] can be applied to the
> target object using [[DefineOwnProperty]] and will not throw an exception."
> doesn't seem to be an invariant mentioned at all in 6.1.7.3.

I agree, this isn't really correct. Deleted that bullet item


fixed in rev33