Changeset 38767 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Nov 25, 2008, 4:09:30 PM (17 years ago)
Author:
[email protected]
Message:

2008-11-25 Cameron Zwarich <[email protected]>

Reviewed by Maciej Stachowiak.

Remove the unused member function JSFunction::getParameterName().

  • runtime/JSFunction.cpp:
  • runtime/JSFunction.h:
Location:
trunk/JavaScriptCore/runtime
Files:
2 edited

Legend:

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

    r38528 r38767  
    148148}
    149149
    150 /* Returns the parameter name corresponding to the given index. eg:
    151  * function f1(x, y, z): getParameterName(0) --> x
    152  *
    153  * If a name appears more than once, only the last index at which
    154  * it appears associates with it. eg:
    155  * function f2(x, x): getParameterName(0) --> null
    156  */
    157 const Identifier& JSFunction::getParameterName(int index)
    158 {
    159     const Identifier* parameters = m_body->parameters();
    160 
    161     if (static_cast<size_t>(index) >= m_body->parameterCount())
    162         return m_scopeChain.globalObject()->globalData()->propertyNames->nullIdentifier;
    163  
    164     const Identifier& name = parameters[index];
    165 
    166     // Are there any subsequent parameters with the same name?
    167     size_t size = m_body->parameterCount();
    168     for (size_t i = index + 1; i < size; ++i) {
    169         if (parameters[i] == name)
    170             return m_scopeChain.globalObject()->globalData()->propertyNames->nullIdentifier;
    171     }
    172 
    173     return name;
    174 }
    175 
    176150// ECMA 13.2.2 [[Construct]]
    177151ConstructType JSFunction::getConstructData(ConstructData& constructData)
  • trunk/JavaScriptCore/runtime/JSFunction.h

    r38473 r38767  
    5555        JSValue* call(ExecState*, JSValue* thisValue, const ArgList&);
    5656
    57         // Note: Returns a null identifier for any parameters that will never get set
    58         // due to a later parameter with the same name.
    59         const Identifier& getParameterName(int index);
    60 
    6157        void setScope(const ScopeChain& scopeChain) { m_scopeChain = scopeChain; }
    6258        ScopeChain& scope() { return m_scopeChain; }
Note: See TracChangeset for help on using the changeset viewer.