MCPcopy Create free account
hub / github.com/Tencent/xLua / Check

Method Check

Assets/XLua/Src/MethodWarpsCache.cs:148–176  ·  view source on GitHub ↗
(RealStatePtr L)

Source from the content-addressed store, hash-verified

146 }
147
148 public bool Check(RealStatePtr L)
149 {
150 int luaTop = LuaAPI.lua_gettop(L);
151 int luaStackPos = luaStackPosStart;
152
153 for(int i = 0; i < checkArray.Length; i++)
154 {
155 if ((i == (checkArray.Length - 1)) && (paramsType != null))
156 {
157 break;
158 }
159 if(luaStackPos > luaTop && !isOptionalArray[i])
160 {
161 return false;
162 }
163 else if(luaStackPos <= luaTop && !checkArray[i](L, luaStackPos))
164 {
165 return false;
166 }
167
168 if (luaStackPos <= luaTop || !isOptionalArray[i])
169 {
170 luaStackPos++;
171 }
172 }
173
174 return paramsType != null ? (luaStackPos < luaTop + 1 ?
175 checkArray[checkArray.Length - 1](L, luaStackPos) : true) : luaStackPos == luaTop + 1;
176 }
177
178 public int Call(RealStatePtr L)
179 {

Callers 1

CallMethod · 0.45

Calls 1

lua_gettopMethod · 0.80

Tested by

no test coverage detected