Skip to content

Instantly share code, notes, and snippets.

@Mons
Created July 7, 2021 17:51
Show Gist options
  • Save Mons/543053257e14fe4c5cfdae466b44844e to your computer and use it in GitHub Desktop.
Save Mons/543053257e14fe4c5cfdae466b44844e to your computer and use it in GitHub Desktop.
if not pcall(assert, false, {}) then
local a = _G.assert
assert = function(t, m)
if t == nil then
error("value expected", 2)
end
if not t then
if m == nil then
error("assertion failed", 2)
else
error(m, 2)
end
end
return t
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment