Summary: | REGRESSION: Can't shadow/overwrite window.constructor (causes TypeError exception) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Matt Cooper <matt11ag-webkitbugs> |
Component: | JavaScriptCore | Assignee: | Michael Saboff <msaboff> |
Status: | RESOLVED FIXED | ||
Severity: | Major | CC: | ap, ggaren, msaboff, oliver, sam |
Priority: | P1 | Keywords: | InRadar, Regression |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac (Intel) | ||
OS: | OS X 10.6 | ||
Attachments: |
Description
Matt Cooper
2010-11-03 14:13:28 PDT
Created attachment 72868 [details]
This attachment is simply an html test page that houses the code that throws the unexpected TypeError in WebKit nightly only
This issue is still reproducing over a month later in r74228 (today's latest nightly). I also see the problem manifest on pages like this one: http://jdevadf.oracle.com/adf-richclient-demo/faces/index.jspx The bug here is that window.constructor (a property that exists on all objects by default) can't be shadowed / overwritten. I believe this may have been caused by Michael's recent change to the DOMWindow constructor object. It appears that this was caused with change set <http://trac.webkit.org/changeset/69553>, the change to https://bugs.webkit.org/show_bug.cgi?id=47422 "DOMWindow constructor directly callable". Created attachment 77274 [details]
Patch to allow setting window.constructor.
Added a new extended attribute to the JavaScript code generator called ReplaceableConstructor that will generate a setJS<class>Constructor() method. Added this attribute to the DOMWindow interface.
Updated a test and added a new regression test.
Created attachment 77277 [details]
Updated patch with whitespace fixes.
Committed revision http://trac.webkit.org/changeset/74537 Note that while this bug was fixed in WebKit, the issue still manifests in the mobile version of Safari on iOS 4.3. |