Merge branch 'master-MC1.7.10' into master-MC1.10

This commit is contained in:
payonel 2020-05-14 23:53:57 -07:00
commit 68c54ea08e
3 changed files with 15 additions and 6 deletions

View File

@ -31,8 +31,8 @@ if #args == 0 then
elseif command ~= "" then
--luacheck: globals _ENV
local result, reason = sh.execute(_ENV, command)
if not result then
io.stderr:write((reason and tostring(reason) or "unknown error") .. "\n")
if not result and reason then
io.stderr:write(tostring(reason), "\n")
end
end
elseif command == nil then -- false only means the input was interrupted

View File

@ -198,7 +198,7 @@ function sh.execute(env, command, ...)
if type(words) ~= "table" then
return words, reason
elseif #words == 0 then
return true, 0
return true
end
-- MUST be table.pack for non contiguous ...

View File

@ -73,12 +73,21 @@ class Proxy {
api.API.config = Settings.get.config
if (LuaStateFactory.include52) {
api.Machine.add(classOf[NativeLua52Architecture])
}
// Weird JNLua bug identified
// When loading JNLua (for either 5.2 or 5.3 lua state) there is a static section that the library loads
// being static, it loads once regardless of which lua state is loaded first
// static { REGISTRYINDEX = lua_registryindex(); }
// The problem is that lua_registryindex was removed in 5.3
// Thus, if we load JNLua from a lua5.3 state first, this static section fails
// We must load 5.2 first, AND we know 5.3 will likely fail to load if 5.2 failed
val include52: Boolean = LuaStateFactory.include52
// now that JNLua has been initialized from a lua52 state, we are safe to check 5.3
if (LuaStateFactory.include53) {
api.Machine.add(classOf[NativeLua53Architecture])
}
if (include52) {
api.Machine.add(classOf[NativeLua52Architecture])
}
if (LuaStateFactory.includeLuaJ) {
api.Machine.add(classOf[LuaJLuaArchitecture])
}