| 1250 | |
| 1251 | |
| 1252 | LUA_API int lua_error (lua_State *L) { |
| 1253 | TValue *errobj; |
| 1254 | lua_lock(L); |
| 1255 | errobj = s2v(L->top.p - 1); |
| 1256 | api_checkpop(L, 1); |
| 1257 | /* error object is the memory error message? */ |
| 1258 | if (ttisshrstring(errobj) && eqshrstr(tsvalue(errobj), G(L)->memerrmsg)) |
| 1259 | luaM_error(L); /* raise a memory error */ |
| 1260 | else |
| 1261 | luaG_errormsg(L); /* raise a regular error */ |
| 1262 | /* code unreachable; will unlock when control actually leaves the kernel */ |
| 1263 | return 0; /* to avoid warnings */ |
| 1264 | } |
| 1265 | |
| 1266 | |
| 1267 | LUA_API int lua_next (lua_State *L, int idx) { |
no test coverage detected