archives

« Bugzilla Issues Index

#3309 — 9.1.9 has an opportunity to assert


http://people.mozilla.org/~jorendorff/es6-draft.html#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver

Eliding substeps, the algorithm reads:

> 2. Let ownDesc be the result of calling the [[GetOwnProperty]] internal
> method of O with argument P.
> 3. ReturnIfAbrupt(ownDesc).
> 4. If ownDesc is undefined, then
> ...(substeps either set ownDesc to a PropertyDescriptor or return)
> 5. If IsDataDescriptor(ownDesc) is true, then
> ...(substeps always return)
> 6. If IsAccessorDescriptor(ownDesc) is true, then
> ...

There is an invariant that [[GetOwnProperty]] always returns either a complete PropertyDescriptor or undefined (6.1.7.3). A complete PropertyDescriptor is either a data descriptor or an accessor descriptor (6.2.4.6).

So when we reach step 6, IsAccessorDescriptor(ownDesc) can only be true. It can be asserted instead:

> 6. Else IsAccessorDescriptor(ownDesc),
> ...


fixed in rev29 editor's draft


fixed in rev29