Sigh. I hate you, LuaJIT.

This commit is contained in:
ThePhD 2017-05-09 15:16:51 -04:00
parent 934f55058d
commit 7eccb5883e

View File

@ -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());