| 415 | |
| 416 | |
| 417 | static int db_traceback (lua_State *L) { |
| 418 | int arg; |
| 419 | lua_State *L1 = getthread(L, &arg); |
| 420 | const char *msg = lua_tostring(L, arg + 1); |
| 421 | if (msg == NULL && !lua_isnoneornil(L, arg + 1)) /* non-string 'msg'? */ |
| 422 | lua_pushvalue(L, arg + 1); /* return it untouched */ |
| 423 | else { |
| 424 | int level = (int)luaL_optinteger(L, arg + 2, (L == L1) ? 1 : 0); |
| 425 | luaL_traceback(L, L1, msg, level); |
| 426 | } |
| 427 | return 1; |
| 428 | } |
| 429 | |
| 430 | |
| 431 | static const luaL_Reg dblib[] = { |
nothing calls this directly
no test coverage detected