Ignore:
Timestamp:
Jul 5, 2008, 10:26:58 PM (17 years ago)
Author:
[email protected]
Message:

2008-07-05 Sam Weinig <[email protected]>

Reviewed by Cameron Zwarich.

First step in broad cleanup effort.

[ File list elided ]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSFunction.cpp

    r35016 r35022  
    4242const ClassInfo JSFunction::info = { "Function", &InternalFunction::info, 0, 0 };
    4343
    44 JSFunction::JSFunction(ExecState* exec, const Identifier& name, FunctionBodyNode* b, ScopeChainNode* scopeChain)
    45   : InternalFunction(exec->lexicalGlobalObject()->functionPrototype(), name)
    46   , body(b)
    47   , _scope(scopeChain)
     44JSFunction::JSFunction(ExecState* exec, const Identifier& name, FunctionBodyNode* body, ScopeChainNode* scopeChainNode)
     45    : InternalFunction(exec->lexicalGlobalObject()->functionPrototype(), name)
     46    , m_body(body)
     47    , m_scopeChain(scopeChainNode)
    4848{
    4949}
     
    5252{
    5353    InternalFunction::mark();
    54     body->mark();
    55     _scope.mark();
     54    m_body->mark();
     55    m_scopeChain.mark();
    5656}
    5757
    5858CallType JSFunction::getCallData(CallData& callData)
    5959{
    60     callData.js.functionBody = body.get();
    61     callData.js.scopeChain = _scope.node();
     60    callData.js.functionBody = m_body.get();
     61    callData.js.scopeChain = m_scopeChain.node();
    6262    return CallTypeJS;
    6363}
     
    6565JSValue* JSFunction::call(ExecState* exec, JSValue* thisValue, const ArgList& args)
    6666{
    67     return exec->machine()->execute(body.get(), exec, this, thisValue->toThisObject(exec), args, _scope.node(), exec->exceptionSlot());
     67    return exec->machine()->execute(m_body.get(), exec, this, thisValue->toThisObject(exec), args, m_scopeChain.node(), exec->exceptionSlot());
    6868}
    6969
     
    8383{
    8484    JSFunction* thisObj = static_cast<JSFunction*>(slot.slotBase());
    85     return jsNumber(exec, thisObj->body->parameters().size());
     85    return jsNumber(exec, thisObj->m_body->parameters().size());
    8686}
    8787
     
    129129const Identifier& JSFunction::getParameterName(int index)
    130130{
    131     Vector<Identifier>& parameters = body->parameters();
     131    Vector<Identifier>& parameters = m_body->parameters();
    132132
    133     if (static_cast<size_t>(index) >= body->parameters().size())
    134         return _scope.globalObject()->globalData()->propertyNames->nullIdentifier;
     133    if (static_cast<size_t>(index) >= m_body->parameters().size())
     134        return m_scopeChain.globalObject()->globalData()->propertyNames->nullIdentifier;
    135135 
    136136    const Identifier& name = parameters[index];
     
    138138    // Are there any subsequent parameters with the same name?
    139139    size_t size = parameters.size();
    140     for (size_t i = index + 1; i < size; ++i)
     140    for (size_t i = index + 1; i < size; ++i) {
    141141        if (parameters[i] == name)
    142             return _scope.globalObject()->globalData()->propertyNames->nullIdentifier;
     142            return m_scopeChain.globalObject()->globalData()->propertyNames->nullIdentifier;
     143    }
    143144
    144145    return name;
     
    148149ConstructType JSFunction::getConstructData(ConstructData& constructData)
    149150{
    150     constructData.js.functionBody = body.get();
    151     constructData.js.scopeChain = _scope.node();
     151    constructData.js.functionBody = m_body.get();
     152    constructData.js.scopeChain = m_scopeChain.node();
    152153    return ConstructTypeJS;
    153154}
     
    164165    JSObject* thisObj = new (exec) JSObject(proto);
    165166
    166     JSValue* result = exec->machine()->execute(body.get(), exec, this, thisObj, args, _scope.node(), exec->exceptionSlot());
     167    JSValue* result = exec->machine()->execute(m_body.get(), exec, this, thisObj, args, m_scopeChain.node(), exec->exceptionSlot());
    167168    if (exec->hadException() || !result->isObject())
    168169        return thisObj;
Note: See TracChangeset for help on using the changeset viewer.