MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaB_assert

Function luaB_assert

src/Chain/libraries/glua/lbaselib.cpp:485–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483
484
485static int luaB_assert(lua_State *L) {
486 if (lua_toboolean(L, 1)) /* condition is true? */
487 return lua_gettop(L); /* return all arguments */
488 else { /* error */
489 luaL_checkany(L, 1); /* there must be a condition */
490 lua_remove(L, 1); /* remove it */
491 lua_pushliteral(L, "assertion failed!"); /* default message */
492 lua_settop(L, 1); /* leave only message (default if no other one) */
493 return luaB_error(L); /* call 'error' */
494 }
495}
496
497
498static int luaB_select(lua_State *L) {

Callers

nothing calls this directly

Calls 5

lua_tobooleanFunction · 0.85
lua_gettopFunction · 0.85
luaL_checkanyFunction · 0.85
lua_settopFunction · 0.85
luaB_errorFunction · 0.85

Tested by

no test coverage detected