MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / luaB_assert

Function luaB_assert

src/lbaselib.cpp:505–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503
504
505int luaB_assert (lua_State *L) {
506 if (l_likely(lua_toboolean(L, 1))) /* condition is true? */
507 return lua_gettop(L); /* return all arguments */
508 else { /* error */
509 luaL_checkany(L, 1); /* there must be a condition */
510 lua_remove(L, 1); /* remove it */
511 lua_pushliteral(L, "assertion failed!"); /* default message */
512 lua_settop(L, 1); /* leave only message (default if no other one) */
513 return luaB_error(L); /* call 'error' */
514 }
515}
516
517
518static int luaB_select (lua_State *L) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected