Changeset 13960 in webkit


Ignore:
Timestamp:
Apr 18, 2006, 3:17:41 PM (19 years ago)
Author:
eseidel
Message:

2006-04-18 Eric Seidel <[email protected]>

Reviewed by ggaren.

Fix "new Function()" to correctly use lexical scoping.
Add ScopeChain::print() function for debugging.
<rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server

  • kjs/function_object.cpp: (FunctionObjectImp::construct):
  • kjs/scope_chain.cpp: (KJS::ScopeChain::print):
  • kjs/scope_chain.h:
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r13877 r13960  
     12006-04-18  Eric Seidel  <[email protected]>
     2
     3        Reviewed by ggaren.
     4
     5        Fix "new Function()" to correctly use lexical scoping.
     6        Add ScopeChain::print() function for debugging.
     7        <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
     8
     9        * kjs/function_object.cpp:
     10        (FunctionObjectImp::construct):
     11        * kjs/scope_chain.cpp:
     12        (KJS::ScopeChain::print):
     13        * kjs/scope_chain.h:
     14
    1152006-04-14  James G. Speth  <[email protected]>
    216
  • trunk/JavaScriptCore/kjs/function_object.cpp

    r13465 r13960  
    205205
    206206  ScopeChain scopeChain;
    207   scopeChain.push(exec->dynamicInterpreter()->globalObject());
     207  scopeChain.push(exec->lexicalInterpreter()->globalObject());
    208208  FunctionBodyNode *bodyNode = progNode.get();
    209209
  • trunk/JavaScriptCore/kjs/scope_chain.cpp

    r12949 r13960  
    2222#include "config.h"
    2323#include "scope_chain.h"
     24#include "reference_list.h"
    2425
    2526namespace KJS {
     
    3536}
    3637
     38#ifndef NDEBUG
     39
     40void ScopeChain::print(ExecState* exec)
     41{
     42    ScopeChainIterator scopeEnd = end();
     43    for (ScopeChainIterator scopeIter = begin(); scopeIter != scopeEnd; ++scopeIter) {
     44        JSObject* o = *scopeIter;
     45        ReferenceList propList = o->propList(exec, false);
     46        ReferenceListIterator propEnd = propList.end();
     47
     48        fprintf(stderr, "----- [scope %p] -----\n", o);
     49        for (ReferenceListIterator propIter = propList.begin(); propIter != propEnd; propIter++) {
     50            Identifier name = propIter->getPropertyName(exec);
     51            fprintf(stderr, "%s, ", name.ascii());
     52        }
     53        fprintf(stderr, "\n");
     54    }
     55}
     56
     57#endif
     58
    3759} // namespace KJS
  • trunk/JavaScriptCore/kjs/scope_chain.h

    r12317 r13960  
    2828
    2929    class JSObject;
     30    class ExecState;
    3031   
    3132    class ScopeChainNode {
     
    8081       
    8182        void mark();
     83
     84#ifndef NDEBUG       
     85        void print(ExecState*);
     86#endif
    8287       
    8388    private:
  • trunk/LayoutTests/ChangeLog

    r13959 r13960  
     12006-04-18  Eric Seidel  <[email protected]>
     2
     3        Reviewed by ggaren.
     4
     5        <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
     6
     7        * fast/js/lexical-lookup-in-function-constructor.html: Added.
     8        * fast/js/resources/lexical-lookup-in-function-constructor-child.html: Added.
     9        * fast/js/lexical-lookup-in-function-constructor-expected.txt: Added.
     10
    1112006-04-18  Beth Dakin  <[email protected]>
    212
Note: See TracChangeset for help on using the changeset viewer.