Update Moonsharp for the new pcall exception handling

This commit is contained in:
EvilFactory
2022-10-29 20:30:02 -03:00
parent b77dde156b
commit e7d98dc887
3 changed files with 10 additions and 2 deletions
@@ -53,7 +53,14 @@ luaUserData.AddCallMetaTable = function (userdata)
error("userdata was nil.", 2)
end
return userdata.__new(...)
local success, result = pcall(userdata.__new, ...)
if not success then
error(result, 2)
end
return result
end
})
end