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/function_object.cpp

    r33979 r34007  
    173173   
    174174    functionBody->setSource(SourceRange(source, 0, source->length()));
    175     ScopeChain scopeChain(exec->lexicalGlobalObject());
     175    ScopeChain scopeChain(exec->lexicalGlobalObject(), exec->globalThisValue());
    176176
    177177    FunctionImp* fimp = new FunctionImp(exec, functionName, functionBody.get(), scopeChain.node());
Note: See TracChangeset for help on using the changeset viewer.