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