check tostring result for print

closes #3125
This commit is contained in:
payonel 2019-07-14 14:11:15 -07:00
parent a50b237734
commit 9a1923f7f4

View File

@ -34,7 +34,7 @@ function print(...)
local stdout = io.stdout
local pre = ""
for i = 1, args.n do
stdout:write(pre, tostring(args[i]))
stdout:write(pre, assert(tostring(args[i]), "'tostring' must return a string to 'print'"))
pre = "\t"
end
stdout:write("\n")