MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / searcher_preload

Function searcher_preload

3rd/lua-5.4.3/src/loadlib.c:610–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

608
609
610static int searcher_preload (lua_State *L) {
611 const char *name = luaL_checkstring(L, 1);
612 lua_getfield(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE);
613 if (lua_getfield(L, -1, name) == LUA_TNIL) { /* not found? */
614 lua_pushfstring(L, "no field package.preload['%s']", name);
615 return 1;
616 }
617 else {
618 lua_pushliteral(L, ":preload:");
619 return 2;
620 }
621}
622
623
624static void findloader (lua_State *L, const char *name) {

Callers

nothing calls this directly

Calls 2

lua_getfieldFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by

no test coverage detected