Jason Orendorff (2014-04-29T22:43:04.000Z)
The [[Origin]] field of Property Descriptor Records is not yet
implemented in Firefox. Eric Faust is looking at implementing it.[1]
We noticed two interesting cases:

1. Suppose handler.getOwnPropertyDescriptor returns ({value: 0}). Then
9.5.5 Proxy.[[GetOwnProperty]] calls 6.2.4.6
CompletePropertyDescriptor, and all the fields of the Property
Descriptor Record are populated. But the object itself is not
populated. This means Object.getOwnPropertyDescriptor will return an
object that is missing most of the fields the caller wants to know
about. This seems strange.

2. The object returned by the handler can have getters. It can answer
ToPropertyDescriptor's queries one way, and then say something else
afterwards, making it look like language invariants have been broken.

Come to think of it, [[GetOwnProperty]] is a weird API. It computes
two results: a set of Property Descriptor fields, and an [[Origin]]
object. The ES language itself relies exclusively on the former.
Scripts are only allowed to see the latter. That seems really weird to
me.

What is an example of a concrete use case for this [[Origin]] feature?
Is it to avoid allocating a new object here?

-j

    [1] https://bugzilla.mozilla.org/show_bug.cgi?id=999156
domenic at domenicdenicola.com (2014-05-07T19:15:21.337Z)
The [[Origin]] field of Property Descriptor Records is not yet
implemented in Firefox. [Eric Faust is looking at implementing it.][1]
We noticed two interesting cases:

1. Suppose handler.getOwnPropertyDescriptor returns ({value: 0}). Then
9.5.5 Proxy.[[GetOwnProperty]] calls 6.2.4.6
CompletePropertyDescriptor, and all the fields of the Property
Descriptor Record are populated. But the object itself is not
populated. This means Object.getOwnPropertyDescriptor will return an
object that is missing most of the fields the caller wants to know
about. This seems strange.

2. The object returned by the handler can have getters. It can answer
ToPropertyDescriptor's queries one way, and then say something else
afterwards, making it look like language invariants have been broken.

Come to think of it, [[GetOwnProperty]] is a weird API. It computes
two results: a set of Property Descriptor fields, and an [[Origin]]
object. The ES language itself relies exclusively on the former.
Scripts are only allowed to see the latter. That seems really weird to
me.

What is an example of a concrete use case for this [[Origin]] feature?
Is it to avoid allocating a new object here?

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=999156