Upcoming change to property descriptors

# David Bruant (13 years ago)

From the Bugzilla [1], Allen: "(...) in rev 12 [property descriptors] have been enhanced to include a reference to the object (if any) they were produced from. This permits an descriptor object to pass through the traps behind Object.getOwnpropertyDesceriptor and Object.defineOwnProperty without loosing any extension attributes" I'm not sure I fully understand how this would work. Would it affect current calls?

David

[1] ecmascript#863#c1

# Allen Wirfs-Brock (13 years ago)

You can see the pseudo code very soon...

But, consider that [[GetOwnProperty]] needs to return a descriptor record for internal use, and Object.getOwnPropertyDescriptor needs to use [[GetOwnProperty]] to properly dispatch to different kinds of objects. Get get an exotic descriptor back from the Proxy [[GetOwnProperty]] implementation there needs to be a way to pass a regular object that might include exotic attributes along so that Object.getOwnPropertyDescriptor can return it.

It doesn't effect anything in any JS level APIs, just makes them work with exotic property descriptors.

# Brandon Benvie (13 years ago)

It sounds like this might also be useful to retain the information needed to rebind super for descriptors that go directly from Object.getOwnPropertyDescriptor to Object.defineProperty.