diff options
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r-- | src/lanes.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index afcac1d..aa614b7 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -395,8 +395,8 @@ LUAG_FUNC(lane_new) | |||
395 | raise_luaL_error(L_, "required module list should be a list of strings"); | 395 | raise_luaL_error(L_, "required module list should be a list of strings"); |
396 | } else { | 396 | } else { |
397 | // require the module in the target state, and populate the lookup table there too | 397 | // require the module in the target state, and populate the lookup table there too |
398 | size_t len; | 398 | size_t _len{ 0 }; |
399 | char const* name = lua_tolstring(L_, -1, &len); | 399 | char const* _name{ lua_tolstring(L_, -1, &_len) }; |
400 | DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "lane_new: require '%s'\n" INDENT_END(_U), name)); | 400 | DEBUGSPEW_CODE(fprintf(stderr, INDENT_BEGIN "lane_new: require '%s'\n" INDENT_END(_U), name)); |
401 | 401 | ||
402 | // require the module in the target lane | 402 | // require the module in the target lane |
@@ -405,7 +405,7 @@ LUAG_FUNC(lane_new) | |||
405 | lua_pop(_L2, 1); // L_: [fixed] args... n "modname" L2: | 405 | lua_pop(_L2, 1); // L_: [fixed] args... n "modname" L2: |
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 | if (lua_pcall(_L2, 1, 1, 0) != LUA_OK) { // L_: [fixed] args... n "modname" L2: ret/errcode |
410 | // propagate error to main state if any | 410 | // propagate error to main state if any |
411 | InterCopyContext _c{ _U, DestState{ L_ }, SourceState{ _L2 }, {}, {}, {}, {}, {} }; | 411 | InterCopyContext _c{ _U, DestState{ L_ }, SourceState{ _L2 }, {}, {}, {}, {}, {} }; |
@@ -414,7 +414,7 @@ LUAG_FUNC(lane_new) | |||
414 | } | 414 | } |
415 | // here the module was successfully required // L_: [fixed] args... n "modname" L2: ret | 415 | // here the module was successfully required // L_: [fixed] args... n "modname" L2: ret |
416 | // after requiring the module, register the functions it exported in our name<->function database | 416 | // after requiring the module, register the functions it exported in our name<->function database |
417 | populate_func_lookup_table(_L2, -1, name); | 417 | populate_func_lookup_table(_L2, -1, _name); |
418 | lua_pop(_L2, 1); // L_: [fixed] args... n "modname" L2: | 418 | lua_pop(_L2, 1); // L_: [fixed] args... n "modname" L2: |
419 | } | 419 | } |
420 | } | 420 | } |