Ignore:
Timestamp:
Apr 16, 2008, 1:58:46 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-04-16 Sam Weinig <[email protected]>

Reviewed by Geoffrey Garen.

  • To keep the behavior of the WebKit and JavaScriptCore API's the same, we need to hide the fact that the global object and the window object are no longer the same thing, and the the global object now changes on navigations. To do this, only the wrapper should ever be exposed. This fixes the two remaining spots where the internal global object is exposed, the windowScriptObject returned from [WebFrame windowObject] and the object return by calling JSContextGetGlobalObject on [WebFrame globalContext].
  • API/JSContextRef.cpp: (JSContextGetGlobalObject): This is a bit of a hack, this returns the "this" representation of the globalObject which will be the WrapperWindow for WebCore and the globalObject for non-WebCore.
  • API/JSObjectRef.cpp: (JSObjectSetProperty): Call the new putWithAttributes method instead of relying on lower-level calls. This is needed so that the window wrapper can forward the calls.
  • JavaScriptCore.exp:
  • kjs/Activation.h:
  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::putWithAttributes):
  • kjs/JSGlobalObject.h:
  • kjs/JSVariableObject.h: (KJS::JSVariableObject::symbolTablePutWithAttributes):
  • kjs/function.cpp: (KJS::ActivationImp::putWithAttributes):
  • kjs/nodes.cpp: (KJS::ConstDeclNode::handleSlowCase): (KJS::ConstDeclNode::evaluateSingle): (KJS::EvalNode::processDeclarations):
  • kjs/object.cpp: (KJS::JSObject::putWithAttributes):
  • kjs/object.h: Rename initializeVariable to putWithAttributes and move it down to JSObject so it can be used for JSObjectSetProperty.

WebCore:

2008-04-16 Sam Weinig <[email protected]>

Reviewed by Geoffrey Garen.

  • To keep the behavior of the WebKit and JavaScriptCore API's the same, we need to hide the fact that the global object and the window object are no longer the same thing, and the the global object now changes on navigations. To do this, only the wrapper should ever be exposed. This fixes the two remaining spots where the internal global object is exposed, the windowScriptObject returned from [WebFrame windowObject] and the object return by calling JSContextGetGlobalObject on [WebFrame globalContext]
  • bindings/js/JSDOMWindowWrapper.cpp: (WebCore::JSDOMWindowWrapper::putWithAttributes):
  • bindings/js/JSDOMWindowWrapper.h: Forward this new method so that JSObjectSetProperty doesn't set properties on the wrapper.
  • page/mac/FrameMac.mm: (WebCore::Frame::windowScriptObject): Return the wrapper instead of the global object.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSVariableObject.h

    r31226 r31962  
    4444        void restoreLocalStorage(const SavedProperties&);
    4545
    46         virtual void initializeVariable(ExecState*, const Identifier&, JSValue*, unsigned attributes) = 0;
    47        
     46        virtual void putWithAttributes(ExecState*, const Identifier&, JSValue*, unsigned attributes) = 0;
     47
    4848        virtual bool deleteProperty(ExecState*, const Identifier&);
    4949        virtual void getPropertyNames(ExecState*, PropertyNameArray&);
     
    8686        bool symbolTableGet(const Identifier&, PropertySlot&);
    8787        bool symbolTablePut(const Identifier&, JSValue*);
    88         bool symbolTableInitializeVariable(const Identifier&, JSValue*, unsigned attributes);
     88        bool symbolTablePutWithAttributes(const Identifier&, JSValue*, unsigned attributes);
    8989        bool symbolTableInsert(const Identifier&, JSValue*, unsigned attributes);
    9090
     
    126126    }
    127127
    128     inline bool JSVariableObject::symbolTableInitializeVariable(const Identifier& propertyName, JSValue* value, unsigned attributes)
     128    inline bool JSVariableObject::symbolTablePutWithAttributes(const Identifier& propertyName, JSValue* value, unsigned attributes)
    129129    {
    130130        size_t index = symbolTable().get(propertyName.ustring().rep());
Note: See TracChangeset for help on using the changeset viewer.