Summary: | Object.getOwnPropertyDescriptor always returns undefined for JS API objects | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kent Hansen <kent.hansen> | ||||
Component: | JavaScriptCore | Assignee: | Kent Hansen <kent.hansen> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 33947 | ||||||
Attachments: |
|
Description
Kent Hansen
2010-01-21 06:22:19 PST
Created attachment 47125 [details] Proposed patch Implements the approach suggested by Geoffrey in https://bugs.webkit.org/show_bug.cgi?id=33603#c11. Descriptors always have enumerable=false, even though that might not be true. It's no worse than before, since Object.prototype.propertyIsEnumerable would also return false (since it calls getOwnPropertyDescriptor(), which wasn't implemented). Like I mention in a comment, it can be made more consistent by calling getPropertyNames and checking if the name is in the result, but I've opted not to add that overhead unless it's requested. In a full-blown solution (using access descriptors), the implementation would extract the attributes from the JSStaticValues/JSStaticFunctions if possible, but it doesn't look like the functionality can be completely supported without introducing a new callback in JSClassDefinition (i.e., to get attributes of non-static properties). Comment on attachment 47125 [details]
Proposed patch
Nice.
r=me
Comment on attachment 47125 [details] Proposed patch Clearing flags on attachment: 47125 Committed r53638: <http://trac.webkit.org/changeset/53638> All reviewed patches have been landed. Closing bug. |