Prototype: Fix shitty string serialisation, Lua offers %q fmt
This commit is contained in:
parent
159c336d5a
commit
c5deb5c458
@ -45,7 +45,7 @@ function Prototype:__tostring()
|
|||||||
elseif t=="number" or t=="boolean" then
|
elseif t=="number" or t=="boolean" then
|
||||||
return tostring(self)
|
return tostring(self)
|
||||||
elseif t=="string" then
|
elseif t=="string" then
|
||||||
return "\""..self:gsub("\\","\\\\"):gsub("\"","\\\"").."\""
|
return ("%q"):format(self)
|
||||||
else
|
else
|
||||||
return "nil"
|
return "nil"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user