** Calls 'require(name)' and stores the result in a global variable ** with the given name. */
| 190 | ** with the given name. |
| 191 | */ |
| 192 | static int dolibrary (lua_State *L, const char *name) { |
| 193 | int status; |
| 194 | lua_getglobal(L, "require"); |
| 195 | lua_pushstring(L, name); |
| 196 | status = docall(L, 1, 1); /* call 'require(name)' */ |
| 197 | if (status == LUA_OK) |
| 198 | lua_setglobal(L, name); /* global[name] = require return */ |
| 199 | return report(L, status); |
| 200 | } |
| 201 | |
| 202 | |
| 203 | /* |
no test coverage detected