| 608 | |
| 609 | |
| 610 | static 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 | |
| 624 | static void findloader (lua_State *L, const char *name) { |
nothing calls this directly
no test coverage detected