mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Sigh. I hate you, LuaJIT.
This commit is contained in:
parent
934f55058d
commit
7eccb5883e
|
@ -207,12 +207,13 @@ TEST_CASE("environments/this_environment", "test various situations of pulling o
|
|||
|
||||
sol::state lua;
|
||||
|
||||
lua["f"] = [](sol::this_environment te, int x) {
|
||||
lua["f"] = [](sol::this_environment te, int x, sol::this_state ts) {
|
||||
if (te) {
|
||||
sol::environment& env = te;
|
||||
return x + static_cast<int>(env["x"]);
|
||||
}
|
||||
return x;
|
||||
sol::state_view lua = ts;
|
||||
return x + static_cast<int>(lua["x"]);
|
||||
};
|
||||
|
||||
sol::environment e(lua, sol::create, lua.globals());
|
||||
|
|
Loading…
Reference in New Issue
Block a user