MCPcopy Create free account
hub / github.com/axmolengine/axmol / luaB_pairs

Function luaB_pairs

3rdparty/lua/plainlua/lbaselib.c:284–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284static int luaB_pairs (lua_State *L) {
285 luaL_checkany(L, 1);
286 if (luaL_getmetafield(L, 1, "__pairs") == LUA_TNIL) { /* no metamethod? */
287 lua_pushcfunction(L, luaB_next); /* will return generator, */
288 lua_pushvalue(L, 1); /* state, */
289 lua_pushnil(L); /* and initial value */
290 }
291 else {
292 lua_pushvalue(L, 1); /* argument 'self' to metamethod */
293 lua_callk(L, 1, 3, 0, pairscont); /* get 3 values from metamethod */
294 }
295 return 3;
296}
297
298
299/*

Callers

nothing calls this directly

Calls 5

luaL_checkanyFunction · 0.85
luaL_getmetafieldFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushnilFunction · 0.85
lua_callkFunction · 0.85

Tested by

no test coverage detected