Ignore:
Timestamp:
Jun 12, 2007, 9:25:28 PM (18 years ago)
Author:
andersca
Message:

Reviewed by Oliver.


Get rid of the MethodList class and use a good ol' Vector instead.

  • bindings/c/c_class.cpp: (KJS::Bindings::CClass::methodsNamed):
  • bindings/c/c_instance.cpp: (KJS::Bindings::CInstance::invokeMethod):
  • bindings/jni/jni_class.cpp: (JavaClass::JavaClass): (JavaClass::~JavaClass):
  • bindings/jni/jni_instance.cpp: (JavaInstance::invokeMethod):
  • bindings/objc/objc_class.mm: (KJS::Bindings::ObjcClass::methodsNamed):
  • bindings/objc/objc_instance.mm: (ObjcInstance::invokeMethod):
  • bindings/objc/objc_runtime.mm: (ObjcFallbackObjectImp::callAsFunction):
  • bindings/runtime.cpp:
  • bindings/runtime.h:
  • bindings/runtime_method.cpp: (RuntimeMethod::lengthGetter): (RuntimeMethod::callAsFunction):
  • bindings/runtime_object.cpp: (RuntimeObjectImp::getOwnPropertySlot):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/runtime_method.cpp

    r23478 r23479  
    5454    // FIXME: a better solution might be to give the maximum number of parameters
    5555    // of any method
    56     return jsNumber(thisObj->_methodList->methodAt(0)->numParameters());
     56    return jsNumber(thisObj->_methodList->at(0)->numParameters());
    5757}
    5858
     
    6969JSValue *RuntimeMethod::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
    7070{
    71     if (_methodList->length() > 0) {
    72         RuntimeObjectImp *imp = 0;
     71    if (_methodList->isEmpty())
     72        return jsUndefined();
     73   
     74    RuntimeObjectImp *imp = 0;
    7375
    74         if (thisObj->classInfo() == &KJS::RuntimeObjectImp::info) {
    75             imp = static_cast<RuntimeObjectImp*>(thisObj);
    76         } else {
    77             // If thisObj is the DOM object for a plugin, get the corresponding
    78             // runtime object from the DOM object.
    79             JSValue* value = thisObj->get(exec, "__apple_runtime_object");
    80             if (value->isObject(&KJS::RuntimeObjectImp::info))   
    81                 imp = static_cast<RuntimeObjectImp*>(value);
    82         }
    83 
    84         if (!imp)
    85             return throwError(exec, TypeError);
    86 
    87         Instance *instance = imp->getInternalInstance();
    88         instance->begin();
    89         JSValue *aValue = instance->invokeMethod(exec, *_methodList, args);
    90         instance->end();
    91         return aValue;
     76    if (thisObj->classInfo() == &KJS::RuntimeObjectImp::info) {
     77        imp = static_cast<RuntimeObjectImp*>(thisObj);
     78    } else {
     79        // If thisObj is the DOM object for a plugin, get the corresponding
     80        // runtime object from the DOM object.
     81        JSValue* value = thisObj->get(exec, "__apple_runtime_object");
     82        if (value->isObject(&KJS::RuntimeObjectImp::info))   
     83            imp = static_cast<RuntimeObjectImp*>(value);
    9284    }
    9385
    94     return jsUndefined();
     86    if (!imp)
     87        return throwError(exec, TypeError);
     88
     89    Instance *instance = imp->getInternalInstance();
     90    instance->begin();
     91    JSValue *aValue = instance->invokeMethod(exec, *_methodList, args);
     92    instance->end();
     93    return aValue;
    9594}
    9695
Note: See TracChangeset for help on using the changeset viewer.