MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaB_assert

Function luaB_assert

third-party/lua-5.3.5/src/lbaselib.c:372–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370
371
372static int luaB_assert (lua_State *L) {
373 if (lua_toboolean(L, 1)) /* condition is true? */
374 return lua_gettop(L); /* return all arguments */
375 else { /* error */
376 luaL_checkany(L, 1); /* there must be a condition */
377 lua_remove(L, 1); /* remove it */
378 lua_pushliteral(L, "assertion failed!"); /* default message */
379 lua_settop(L, 1); /* leave only message (default if no other one) */
380 return luaB_error(L); /* call 'error' */
381 }
382}
383
384
385static int luaB_select (lua_State *L) {

Callers

nothing calls this directly

Calls 6

lua_tobooleanFunction · 0.70
lua_gettopFunction · 0.70
luaL_checkanyFunction · 0.70
lua_settopFunction · 0.70
luaB_errorFunction · 0.70
lua_removeFunction · 0.50

Tested by

no test coverage detected