Changeset 23479 in webkit for trunk/JavaScriptCore/bindings/runtime_method.cpp
- Timestamp:
- Jun 12, 2007, 9:25:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bindings/runtime_method.cpp
r23478 r23479 54 54 // FIXME: a better solution might be to give the maximum number of parameters 55 55 // of any method 56 return jsNumber(thisObj->_methodList-> methodAt(0)->numParameters());56 return jsNumber(thisObj->_methodList->at(0)->numParameters()); 57 57 } 58 58 … … 69 69 JSValue *RuntimeMethod::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args) 70 70 { 71 if (_methodList->length() > 0) { 72 RuntimeObjectImp *imp = 0; 71 if (_methodList->isEmpty()) 72 return jsUndefined(); 73 74 RuntimeObjectImp *imp = 0; 73 75 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); 92 84 } 93 85 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; 95 94 } 96 95
Note:
See TracChangeset
for help on using the changeset viewer.