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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.