[webkit-reviews] review requested: [Bug 33946] Object.getOwnPropertyDescriptor always returns undefined for JS API objects : [Attachment 47125] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 21 08:38:38 PST 2010


Kent Hansen <kent.hansen at nokia.com> has asked  for review:
Bug 33946: Object.getOwnPropertyDescriptor always returns undefined for JS API
objects
https://bugs.webkit.org/show_bug.cgi?id=33946

Attachment 47125: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=47125&action=review

------- Additional Comments from Kent Hansen <kent.hansen at nokia.com>
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).


More information about the webkit-reviews mailing list