libs/web: transparently handle userdata in write_json()

This commit is contained in:
Jo-Philipp Wich 2012-09-15 14:25:18 +00:00
parent 8772db1675
commit b0d3b82400

View file

@ -339,7 +339,7 @@ function write_json(x)
else else
write(tostring(x)) write(tostring(x))
end end
elseif type(x) == "string" then else
write("%q" % tostring(x)) write("%q" % tostring(x))
end end
end end