| 601 | |
| 602 | |
| 603 | static int searcher_preload (lua_State *L) { |
| 604 | const char *name = luaL_checkstring(L, 1); |
| 605 | lua_getfield(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE); |
| 606 | if (lua_getfield(L, -1, name) == LUA_TNIL) { /* not found? */ |
| 607 | lua_pushfstring(L, "no field package.preload['%s']", name); |
| 608 | return 1; |
| 609 | } |
| 610 | else { |
| 611 | lua_pushliteral(L, ":preload:"); |
| 612 | return 2; |
| 613 | } |
| 614 | } |
| 615 | |
| 616 | |
| 617 | static void findloader (lua_State *L, const char *name) { |
nothing calls this directly
no test coverage detected