changeset 6771:5fe28c321c09 8u5-b05

Fixed RT-35021: Improve JavaScript linking
author lepopov
date Thu, 16 Jan 2014 16:56:57 +0400
parents 4171f2b5f001
children dd7791983bea dcebb408a400 57906070ee23
files modules/web/src/main/native/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/web/src/main/native/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp	Tue Jan 14 18:20:10 2014 -0800
+++ b/modules/web/src/main/native/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp	Thu Jan 16 16:56:57 2014 +0400
@@ -225,6 +225,11 @@
     const JavaMethod* jMethod = static_cast<const JavaMethod*>(method);
     LOG(LiveConnect, "JavaInstance::invokeMethod call %s %s on %p", String(jMethod->name().impl()).utf8().data(), jMethod->signature(), m_instance->instance());
 
+    if (jMethod->numParameters() != count) {
+        LOG(LiveConnect, "JavaInstance::invokeMethod unable to find an appropriate method with specified signature");
+        return jsUndefined();
+    }
+	
     Vector<jobject> jArgs(count);
 
     for (int i = 0; i < count; i++) {