diff options
Diffstat (limited to 'src/deep.cpp')
-rw-r--r-- | src/deep.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/deep.cpp b/src/deep.cpp index f23f0be..a39e0f8 100644 --- a/src/deep.cpp +++ b/src/deep.cpp | |||
@@ -249,7 +249,7 @@ std::string_view DeepFactory::PushDeepProxy(DestState L_, DeepPrelude* prelude_, | |||
249 | lua_getglobal(L_, "require"); // L_: DPC proxy metatable require() | 249 | lua_getglobal(L_, "require"); // L_: DPC proxy metatable require() |
250 | // check that the module is already loaded (or being loaded, we are happy either way) | 250 | // check that the module is already loaded (or being loaded, we are happy either way) |
251 | if (lua_isfunction(L_, -1)) { | 251 | if (lua_isfunction(L_, -1)) { |
252 | lua_pushlstring(L_, _modname.data(), _modname.size()); // L_: DPC proxy metatable require() "module" | 252 | std::ignore = lua_pushstringview(L_, _modname); // L_: DPC proxy metatable require() "module" |
253 | if (luaG_getfield(L_, LUA_REGISTRYINDEX, LUA_LOADED_TABLE) == LuaType::TABLE) { // L_: DPC proxy metatable require() "module" _R._LOADED | 253 | if (luaG_getfield(L_, LUA_REGISTRYINDEX, LUA_LOADED_TABLE) == LuaType::TABLE) { // L_: DPC proxy metatable require() "module" _R._LOADED |
254 | lua_pushvalue(L_, -2); // L_: DPC proxy metatable require() "module" _R._LOADED "module" | 254 | lua_pushvalue(L_, -2); // L_: DPC proxy metatable require() "module" _R._LOADED "module" |
255 | lua_rawget(L_, -2); // L_: DPC proxy metatable require() "module" _R._LOADED module | 255 | lua_rawget(L_, -2); // L_: DPC proxy metatable require() "module" _R._LOADED module |
@@ -260,7 +260,7 @@ std::string_view DeepFactory::PushDeepProxy(DestState L_, DeepPrelude* prelude_, | |||
260 | LuaError const _require_result{ lua_pcall(L_, 1, 0, 0) }; // L_: DPC proxy metatable error? | 260 | LuaError const _require_result{ lua_pcall(L_, 1, 0, 0) }; // L_: DPC proxy metatable error? |
261 | if (_require_result != LuaError::OK) { | 261 | if (_require_result != LuaError::OK) { |
262 | // failed, return the error message | 262 | // failed, return the error message |
263 | lua_pushfstring(L_, "error while requiring '%s' identified by DeepFactory::moduleName: ", _modname.data()); | 263 | lua_pushfstring(L_, "error while requiring '" STRINGVIEW_FMT "' identified by DeepFactory::moduleName: ", _modname.size(), _modname.data()); |
264 | lua_insert(L_, -2); // L_: DPC proxy metatable prefix error | 264 | lua_insert(L_, -2); // L_: DPC proxy metatable prefix error |
265 | lua_concat(L_, 2); // L_: DPC proxy metatable error | 265 | lua_concat(L_, 2); // L_: DPC proxy metatable error |
266 | return lua_tostringview(L_, -1); | 266 | return lua_tostringview(L_, -1); |