mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2024-12-28 18:18:52 +00:00
Fix bug in lua_ui/content.lua: getmetatable(ui.content{}) shouldn't return a global mutable table
This commit is contained in:
parent
65885d994f
commit
eceeb15ee5
@ -42,7 +42,7 @@ namespace
|
||||
mLuaState.sol()["M"] = makeContent(makeTable()).getMetatable();
|
||||
std::string testScript = R"(
|
||||
assert(not pcall(function() setmetatable(makeContent{}, {}) end), 'Metatable is not protected')
|
||||
assert(getmetatable(makeContent{}) ~= M, 'Metatable is not protected')
|
||||
assert(getmetatable(makeContent{}) == false, 'Metatable is not protected')
|
||||
)";
|
||||
EXPECT_NO_THROW(mLuaState.sol().safe_script(testScript));
|
||||
}
|
||||
|
@ -135,6 +135,6 @@ M.__pairs = function(self)
|
||||
return next, self, 1
|
||||
end
|
||||
M.__ipairs = M.__pairs
|
||||
M.__metatable = {}
|
||||
M.__metatable = false
|
||||
|
||||
return M
|
||||
|
Loading…
Reference in New Issue
Block a user