archives

« Bugzilla Issues Index

#863 — Make property descriptors regular objects


Proxies force to expose the abstract Property Descriptors data structures into regular objects (to be used as trap arguments for defineProperty). Since property descriptors (returned by getOwnPropertyDescriptor) could be proxies themselves, it is necessary to make internal operations deal with the object interface (to know which trap is called, etc.)

I feel having property descriptors as regular objects would make things easier.


I think we want to keep internal property descriptor records. However in rev 12 the 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


(In reply to comment #1)
> I think we want to keep internal property descriptor records.
Indeed. It sounds like the conclusion of the discussion started at https://mail.mozilla.org/pipermail/es-discuss/2012-October/026074.html


> However in rev
> 12 the 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 haven't been following very carefully all the recent discussion between you and Tom, but I don't recall having read about this.
I'll post my comments and questions on es-discuss so we can have a broad discussion.


corrected in rev 12, Nov. 22, 2012 draft