mirror of
https://gitcode.com/JianFeeeee/LuaCangjia_api.git
synced 2026-09-20 00:48:47 +00:00
update runner docs and align tests
This commit is contained in:
@ -170,7 +170,7 @@ int Lua_runner::run(const char *path,const char *arg)
|
||||
{
|
||||
if(!this->check_luastatue())//检查lua状态机状态
|
||||
return -1;
|
||||
|
||||
|
||||
if(path != NULL)//加载脚本到栈
|
||||
{
|
||||
if(this->load_lib(path,path) != 0)
|
||||
@ -180,12 +180,14 @@ int Lua_runner::run(const char *path,const char *arg)
|
||||
{
|
||||
lua_pushlstring(this->L,arg,strlen(arg));
|
||||
}
|
||||
if(this->pkg_cont<0)//检查是否有可调用chunk
|
||||
if(this->pkg_cont <= 0)//检查是否有可调用chunk
|
||||
{
|
||||
errno = NAPI_NOCHUNK_FOUND;
|
||||
return -1;
|
||||
}
|
||||
int argcount = lua_gettop(this->L) - this->pkgs[this->pkg_cont-1].ref;//获取入参数量
|
||||
int func_index = this->pkgs[this->pkg_cont-1].ref - 1;
|
||||
int top = lua_gettop(this->L);
|
||||
int argcount = top - func_index;//获取入参数量
|
||||
if(argcount<0)
|
||||
{
|
||||
errno = NAPI_LUA_STACK_ERROR;
|
||||
@ -213,4 +215,4 @@ int Lua_runner::callfunction()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user