/Tukui/modules/unitframes/core/oUF/private.lua
http://github.com/Asphyxia/Tukui · Lua · 22 lines · 19 code · 3 blank · 0 comment · 4 complexity · 1cea86a07da0112d3714bf30baa50701 MD5 · raw file
- local parent, ns = ...
- local Private = ns.oUF.Private
- function Private.argcheck(value, num, ...)
- assert(type(num) == 'number', "Bad argument #2 to 'argcheck' (number expected, got "..type(num)..")")
- for i=1,select("#", ...) do
- if type(value) == select(i, ...) then return end
- end
- local types = strjoin(", ", ...)
- local name = string.match(debugstack(2,2,0), ": in function [`<](.-)['>]")
- error(("Bad argument #%d to '%s' (%s expected, got %s"):format(num, name, types, type(value)), 3)
- end
- function Private.print(...)
- print("|cff33ff99oUF:|r", ...)
- end
- function Private.error(...)
- Private.print("|cffff0000Error:|r "..string.format(...))
- end