** Calls 'require(name)' and stores the result in a global variable ** with the given name. */
| 255 | ** with the given name. |
| 256 | */ |
| 257 | static int dolibrary(lua_State *L, const char *name) { |
| 258 | int status; |
| 259 | lua_getglobal(L, "require"); |
| 260 | lua_pushstring(L, name); |
| 261 | status = docall(L, 1, 1); /* call 'require(name)' */ |
| 262 | if (status == LUA_OK) |
| 263 | lua_setglobal(L, name); /* global[name] = require return */ |
| 264 | return report(L, status); |
| 265 | } |
| 266 | |
| 267 | |
| 268 | /* |
no test coverage detected