** Calls 'require(name)' and stores the result in a global variable ** with the given name. */
| 211 | ** with the given name. |
| 212 | */ |
| 213 | static int dolibrary (lua_State *L, const char *name) { |
| 214 | int status; |
| 215 | lua_getglobal(L, "require"); |
| 216 | lua_pushstring(L, name); |
| 217 | status = docall(L, 1, 1); /* call 'require(name)' */ |
| 218 | if (status == LUA_OK) |
| 219 | lua_setglobal(L, name); /* global[name] = require return */ |
| 220 | return report(L, status); |
| 221 | } |
| 222 | |
| 223 | |
| 224 | /* |
no test coverage detected