Bug 71333

Summary: Object.getOwnPropertyDescriptor() does not retrieve the getter/setter from a property on the window that has been overridden with a getter/setter
Product: WebKit Reporter: Sam Weinig <sam>
Component: JavaScriptCoreAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch barraclough: review+

Sam Weinig
Reported 2011-11-01 15:32:51 PDT
Object.getOwnPropertyDescriptor().get/set does not behave the same as __lookupGetter__/__lookupSetter__ on window properties. For: window.y = 1; window.__defineGetter__("y", function() { return "window.y __getter__"; }); __lookupGetter__ doesn't do the same thing as Object.getOwnPropertyDescriptor: typeof window.__lookupGetter__('y') != typeof Object.getOwnPropertyDescriptor(window, 'y').get;
Attachments
Patch (3.73 KB, patch)
2011-11-02 20:39 PDT, Sam Weinig
barraclough: review+
Sam Weinig
Comment 1 2011-11-01 15:41:24 PDT
This is now tested in fast/dom/getter-on-window-object2.html.
Sam Weinig
Comment 2 2011-11-01 16:02:39 PDT
The real bug here is not that they behave inconsistently (that will be change shortly by implementing __lookupGetter__ in terms of Object.getOwnPropertyDescriptor()), but that Object.getOwnPropertyDescriptor() does not retrieve the getter/setter from a property on the window that has been overridden with a getter/setter.
Sam Weinig
Comment 3 2011-11-01 19:37:10 PDT
As of r99034, __lookupGetter__/__lookupSetter__ match Object.getOwnPropertyDescriptor, and now both are wrong.
Sam Weinig
Comment 4 2011-11-02 20:39:16 PDT
Sam Weinig
Comment 5 2011-11-02 21:17:59 PDT
Note You need to log in before you can comment on or make changes to this bug.