Ignore:
Timestamp:
May 21, 2008, 10:02:47 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-05-21 Maciej Stachowiak <[email protected]>

Reviewed by Oliver and Sam.


  • fixed <rdar://problem/5815631> REGRESSION (r31239): Multiscope optimisation of function calls results in incorrect this value (breaks tvtv.de)


Track global this value in the scope chain so we can retrieve it
efficiently but it follows lexical scope properly.

  • kjs/ExecState.h: (KJS::ExecState::globalThisValue):
  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
  • kjs/function_object.cpp: (KJS::FunctionObjectImp::construct):
  • kjs/scope_chain.h: (KJS::ScopeChainNode::ScopeChainNode): (KJS::ScopeChainNode::globalThisObject): (KJS::ScopeChainNode::push): (KJS::ScopeChain::ScopeChain):

LayoutTests:

2008-05-21 Maciej Stachowiak <[email protected]>

Reviewed by Oliver and Sam.


  • tests for <rdar://problem/5815631> REGRESSION (r31239): Multiscope optimisation of function calls results in incorrect this value (breaks tvtv.de)
  • fast/frames/cross-site-this-expected.txt: Added.
  • fast/frames/cross-site-this.html: Added.
  • fast/frames/resources/cross-site-this-helper.html: Added.
File:
1 edited

Legend:

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

    r33980 r34007  
    8383            JSGlobalObjectData(JSGlobalObject* globalObject, JSObject* thisValue)
    8484                : JSVariableObjectData(&symbolTable, registerFileStack.globalBasePointer(), 0)
    85                 , globalScopeChain(globalObject)
     85                , globalScopeChain(globalObject, thisValue)
    8686                , globalExec(new ExecState(globalObject, thisValue, globalScopeChain.node()))
    8787            {
Note: See TracChangeset for help on using the changeset viewer.