Changeset 26074 in webkit for trunk/JavaScriptCore/kjs/object.cpp


Ignore:
Timestamp:
Oct 5, 2007, 5:54:00 PM (18 years ago)
Author:
ggaren
Message:

JavaScriptCore:

Reviewed by Sam Weinig.


Added JSObject::removeDirect, to support the fix for
<rdar://problem/5522487> REGRESSION: With JavaScript disabled, any
page load causes a crash in PropertyMap::put

  • kjs/object.cpp: (KJS::JSObject::removeDirect):
  • kjs/object.h:

WebCore:

Reviewed by Sam Weinig.


New fix for <rdar://problem/5522487> REGRESSION: With JavaScript
disabled, any page load causes a crash in PropertyMap::put


Explicitly remove the "document" property from the window. The old
solution would leave a stale "document" property around after JavaScript
was re-enabled.

The architecture for disabling JavaScript could use some consolidation.
It seems wrong that a script proxy even exists when JavaScript is
disabled. It also seems wrong that so many individual call sites are
responsible for checking whether JavaScript is enabled. I've filed a
bug about this: http://bugs.webkit.org/show_bug.cgi?id=15385.

  • bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::clearDocumentWrapper):
  • bindings/js/kjs_proxy.h:
  • page/Frame.cpp: (WebCore::Frame::setDocument):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/object.cpp

    r25161 r26074  
    559559}
    560560
     561void JSObject::removeDirect(const Identifier &propertyName)
     562{
     563    _prop.remove(propertyName);
     564}
     565
    561566void JSObject::putDirectFunction(InternalFunctionImp* func, int attr)
    562567{
Note: See TracChangeset for help on using the changeset viewer.