Fix bug where callObjC() missclassified methods taking an object and returning an object.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5392 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2012-10-02 21:44:43 +00:00
parent aa15e3e1bc
commit 5f518f0c5f

View File

@ -103,7 +103,7 @@ BOOL OOJSCallObjCObjectMethod(JSContext *context, id object, NSString *oo_jsClas
[PLAYER setScriptTarget:object]; [PLAYER setScriptTarget:object];
} }
selectorString = OOStringFromJSValue(context,argv[0]); selectorString = OOStringFromJSValue(context, argv[0]);
// Join all parameters together with spaces. // Join all parameters together with spaces.
if (1 < argc && [selectorString hasSuffix:@":"]) if (1 < argc && [selectorString hasSuffix:@":"])
@ -226,13 +226,14 @@ static BOOL SignatureMatch(NSMethodSignature *sig, SEL selector)
static MethodType GetMethodType(id object, SEL selector) static MethodType GetMethodType(id object, SEL selector)
{ {
NSMethodSignature *sig = [object methodSignatureForSelector:selector]; NSMethodSignature *sig = [object methodSignatureForSelector:selector];
MethodType type = (MethodType)OOShaderUniformTypeFromMethodSignature(sig);
if (type != kMethodTypeInvalid) return type;
if (SignatureMatch(sig, @selector(voidVoidMethod))) return kMethodTypeVoidVoid; if (SignatureMatch(sig, @selector(voidVoidMethod))) return kMethodTypeVoidVoid;
if (SignatureMatch(sig, @selector(voidObjectMethod:))) return kMethodTypeVoidObject; if (SignatureMatch(sig, @selector(voidObjectMethod:))) return kMethodTypeVoidObject;
if (SignatureMatch(sig, @selector(objectObjectMethod:))) return kMethodTypeObjectObject; if (SignatureMatch(sig, @selector(objectObjectMethod:))) return kMethodTypeObjectObject;
MethodType type = (MethodType)OOShaderUniformTypeFromMethodSignature(sig);
if (type != kMethodTypeInvalid) return type;
return kMethodTypeInvalid; return kMethodTypeInvalid;
} }