| 367 | |
| 368 | |
| 369 | static int db_traceback (lua_State *L) { |
| 370 | int arg; |
| 371 | lua_State *L1 = getthread(L, &arg); |
| 372 | const char *msg = lua_tostring(L, arg + 1); |
| 373 | if (msg == NULL && !lua_isnoneornil(L, arg + 1)) /* non-string 'msg'? */ |
| 374 | lua_pushvalue(L, arg + 1); /* return it untouched */ |
| 375 | else { |
| 376 | int level = luaL_optint(L, arg + 2, (L == L1) ? 1 : 0); |
| 377 | luaL_traceback(L, L1, msg, level); |
| 378 | } |
| 379 | return 1; |
| 380 | } |
| 381 | |
| 382 | |
| 383 | static const luaL_Reg dblib[] = { |
nothing calls this directly
no test coverage detected