diff options
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r-- | src/lanes.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index aa614b7..a68c3aa 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -406,7 +406,8 @@ LUAG_FUNC(lane_new) | |||
406 | raise_luaL_error(L_, "cannot pre-require modules without loading 'package' library first"); | 406 | raise_luaL_error(L_, "cannot pre-require modules without loading 'package' library first"); |
407 | } else { | 407 | } else { |
408 | lua_pushlstring(_L2, _name, _len); // L_: [fixed] args... n "modname" L2: require() name | 408 | lua_pushlstring(_L2, _name, _len); // L_: [fixed] args... n "modname" L2: require() name |
409 | if (lua_pcall(_L2, 1, 1, 0) != LUA_OK) { // L_: [fixed] args... n "modname" L2: ret/errcode | 409 | LuaError const _rc{ lua_pcall(_L2, 1, 1, 0) }; // L_: [fixed] args... n "modname" L2: ret/errcode |
410 | if (_rc != LuaError::OK) { | ||
410 | // propagate error to main state if any | 411 | // propagate error to main state if any |
411 | InterCopyContext _c{ _U, DestState{ L_ }, SourceState{ _L2 }, {}, {}, {}, {}, {} }; | 412 | InterCopyContext _c{ _U, DestState{ L_ }, SourceState{ _L2 }, {}, {}, {}, {}, {} }; |
412 | std::ignore = _c.inter_move(1); // L_: [fixed] args... n "modname" error L2: | 413 | std::ignore = _c.inter_move(1); // L_: [fixed] args... n "modname" error L2: |
@@ -870,8 +871,8 @@ LANES_API int luaopen_lanes_core(lua_State* L_) | |||
870 | 871 | ||
871 | [[nodiscard]] static int default_luaopen_lanes(lua_State* L_) | 872 | [[nodiscard]] static int default_luaopen_lanes(lua_State* L_) |
872 | { | 873 | { |
873 | int const _rc{ luaL_loadfile(L_, "lanes.lua") || lua_pcall(L_, 0, 1, 0) }; | 874 | LuaError const _rc{ luaL_loadfile(L_, "lanes.lua") || lua_pcall(L_, 0, 1, 0) }; |
874 | if (_rc != LUA_OK) { | 875 | if (_rc != LuaError::OK) { |
875 | raise_luaL_error(L_, "failed to initialize embedded Lanes"); | 876 | raise_luaL_error(L_, "failed to initialize embedded Lanes"); |
876 | } | 877 | } |
877 | return 1; | 878 | return 1; |