Merge branch 'v3' of https://github.com/shinhirota/cocos2d-x into callStaticMethodWithBool

This commit is contained in:
jianglong0156 2015-07-01 10:30:13 +08:00
commit d6c039f528
1 changed files with 11 additions and 1 deletions

View File

@ -111,9 +111,19 @@ bool JavaScriptObjCBridge::CallInfo::execute(JSContext *cx,jsval *argv,unsigned
if(m_dic != nil){
for(int i = 2;i<m_dic.count+2;i++){
id obj = [m_dic objectForKey:[NSString stringWithFormat:@"argument%d",i-2] ];
if ([obj isKindOfClass:[NSNumber class]] &&
((strcmp([obj objCType], "c") == 0 || strcmp([obj objCType], "B") == 0))) //BOOL
{
bool b = [obj boolValue];
[invocation setArgument:&b atIndex:i];
}
else
{
[invocation setArgument:&obj atIndex:i];
}
}
}
NSUInteger returnLength = [methodSig methodReturnLength];
const char *returnType = [methodSig methodReturnType];
[invocation invoke];