| 386 | |
| 387 | |
| 388 | static int luaB_assert (lua_State *L) { |
| 389 | if (lua_toboolean(L, 1)) /* condition is true? */ |
| 390 | return lua_gettop(L); /* return all arguments */ |
| 391 | else { /* error */ |
| 392 | luaL_checkany(L, 1); /* there must be a condition */ |
| 393 | lua_remove(L, 1); /* remove it */ |
| 394 | lua_pushliteral(L, "assertion failed!"); /* default message */ |
| 395 | lua_settop(L, 1); /* leave only message (default if no other one) */ |
| 396 | return luaB_error(L); /* call 'error' */ |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | |
| 401 | static int luaB_select (lua_State *L) { |
nothing calls this directly
no test coverage detected