diff options
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/state.cpp b/src/state.cpp index 379b63e..9898812 100644 --- a/src/state.cpp +++ b/src/state.cpp | |||
@@ -205,7 +205,7 @@ static void copy_one_time_settings(Universe* U, SourceState L1, DestState L2) | |||
205 | InterCopyContext c{ U, L2, L1, {}, {}, {}, {}, {} }; | 205 | InterCopyContext c{ U, L2, L1, {}, {}, {}, {}, {} }; |
206 | if (c.inter_move(1) != InterCopyResult::Success) // // config | 206 | if (c.inter_move(1) != InterCopyResult::Success) // // config |
207 | { | 207 | { |
208 | luaL_error(L1, "failed to copy settings when loading lanes.core"); // doesn't return | 208 | raise_luaL_error(L1, "failed to copy settings when loading lanes.core"); |
209 | } | 209 | } |
210 | // set L2:_R[kConfigRegKey] = settings | 210 | // set L2:_R[kConfigRegKey] = settings |
211 | kConfigRegKey.setValue(L2, [](lua_State* L) { lua_insert(L, -2); }); // config | 211 | kConfigRegKey.setValue(L2, [](lua_State* L) { lua_insert(L, -2); }); // config |
@@ -229,7 +229,7 @@ void initialize_on_state_create( Universe* U, lua_State* L) | |||
229 | char const* upname = lua_getupvalue(L, -1, 1); // settings on_state_create upval? | 229 | char const* upname = lua_getupvalue(L, -1, 1); // settings on_state_create upval? |
230 | if (upname != nullptr) // should be "" for C functions with upvalues if any | 230 | if (upname != nullptr) // should be "" for C functions with upvalues if any |
231 | { | 231 | { |
232 | (void) luaL_error(L, "on_state_create shouldn't have upvalues"); | 232 | raise_luaL_error(L, "on_state_create shouldn't have upvalues"); |
233 | } | 233 | } |
234 | // remove this C function from the config table so that it doesn't cause problems | 234 | // remove this C function from the config table so that it doesn't cause problems |
235 | // when we transfer the config table in newly created Lua states | 235 | // when we transfer the config table in newly created Lua states |
@@ -274,7 +274,7 @@ lua_State* create_state(Universe* U, lua_State* from_) | |||
274 | 274 | ||
275 | if (L == nullptr) | 275 | if (L == nullptr) |
276 | { | 276 | { |
277 | luaL_error(from_, "luaG_newstate() failed while creating state; out of memory"); // doesn't return | 277 | raise_luaL_error(from_, "luaG_newstate() failed while creating state; out of memory"); |
278 | } | 278 | } |
279 | return L; | 279 | return L; |
280 | } | 280 | } |
@@ -310,7 +310,7 @@ void call_on_state_create(Universe* U, lua_State* L, lua_State* from_, LookupMod | |||
310 | // capture error and raise it in caller state | 310 | // capture error and raise it in caller state |
311 | if (lua_pcall(L, 0, 0, 0) != LUA_OK) | 311 | if (lua_pcall(L, 0, 0, 0) != LUA_OK) |
312 | { | 312 | { |
313 | luaL_error(from_, "on_state_create failed: \"%s\"", lua_isstring(L, -1) ? lua_tostring(L, -1) : lua_typename(L, lua_type(L, -1))); | 313 | raise_luaL_error(from_, "on_state_create failed: \"%s\"", lua_isstring(L, -1) ? lua_tostring(L, -1) : lua_typename(L, lua_type(L, -1))); |
314 | } | 314 | } |
315 | STACK_CHECK(L, 0); | 315 | STACK_CHECK(L, 0); |
316 | } | 316 | } |