Commit b230a86d authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/modjni: Return any object type value as a jobject.

parent 51673321
......@@ -237,14 +237,22 @@ ret_string:;
ret = mp_obj_new_str(s, strlen(s), false);
JJ(ReleaseStringUTFChars, arg, s);
return ret;
} else if (MATCH(jtypesig, "java.lang.Object")) {
if (JJ(IsInstanceOf, arg, String_class)) {
goto ret_string;
} else {
return new_jobject(arg);
} else {
while (*jtypesig != ' ' && *jtypesig) {
if (*jtypesig == '.') {
// Non-primitive, object type
if (JJ(IsInstanceOf, arg, String_class)) {
goto ret_string;
} else {
return new_jobject(arg);
}
}
jtypesig++;
}
}
printf("Unknown return type: %s\n", jtypesig);
return MP_OBJ_NULL;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment