Skip to content

Commit

Permalink
Android平台下的优化
Browse files Browse the repository at this point in the history
Former-commit-id: 4f13d09c5f557d610bac5b13044ba4a69208eaa7
  • Loading branch information
vimfung committed Mar 7, 2017
1 parent 5ba9d14 commit 5600266
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 8 deletions.
11 changes: 11 additions & 0 deletions Sample/Android/app/src/main/assets/todo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@ function makeList()
end

return list;
end

function getFunc()

return function (a, b)

print("------", a, b);
return a * b;

end

end
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public void onClick(View v) {
LuaValue retValue = _luaContext.callMethod("add", new LuaValue[]{new LuaValue(100), new LuaValue(924)});
Log.v("luaScriptCore",String.format("%d", retValue.toInteger()));

LuaValue funcValue = _luaContext.callMethod("getFunc", null);
retValue = funcValue.toFunction().invoke(new LuaValue[]{new LuaValue(100), new LuaValue(924)});
Log.v("luaScriptCore",String.format("%d", retValue.toInteger()));

}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
52d7c7f06a995db51d0251a179fc160b2738ded3
62e6392b6dd179bbe243d4944d14cf6f45a43f0e
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a488904f2a4b7c6e2bb931e689a08c76ab3ec924
13cf23270c9f79a31ba0ae11b29db4f366a701ba
Original file line number Diff line number Diff line change
@@ -1 +1 @@
98c399db662ce7d6a9acb8865181240a57861202
799fe41703f55c771bf70c6a61edd024f4fa30ef
Original file line number Diff line number Diff line change
@@ -1 +1 @@
79d905b48d9d5dfcb31caae507cdf890bd011fb3
3e6dc764293dfbabf0d9962a7eb913b73a079434
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c1eb7434282ac916adec3fec5765b3eea09e2be1
2d30e2a9aa321f2c80e45197b97c817952276416
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7f40c64a7fd42ecd226934d2dbadf90bb9b717cf
2f652b32ea361fc8b8c9409e5b1692968a53af63
Original file line number Diff line number Diff line change
@@ -1 +1 @@
25f49f630a7d061f77aa3d2e5df909be95664bbe
e3f06b5416072de4469e0cfe3803e90a5fcd5d86
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ jobject LuaJavaConverter::convertToJavaObjectByLuaValue(JNIEnv *env, LuaContext
//填充数据
for (int i = 0; i < tuple->count(); ++i)
{
LuaValue *retValue = tuple -> getResturValueByIndex(i);
LuaValue *retValue = tuple -> getReturnValueByIndex(i);
jobject jRetValue = LuaJavaConverter::convertToJavaObjectByLuaValue(env, context, retValue);
if (jRetValue != NULL)
{
Expand Down

0 comments on commit 5600266

Please sign in to comment.