Merge pull request #467 from Blizzard/tostring-fix
table.tostring should displays the metatable.
This commit is contained in:
commit
4f3a554a0c
@ -448,6 +448,15 @@
|
||||
|
||||
if type(tab) == "table" then
|
||||
local first = true
|
||||
|
||||
-- add the meta table.
|
||||
local mt = getmetatable(tab)
|
||||
if mt then
|
||||
res = res .. format_value('__mt', mt, indent)
|
||||
first = false
|
||||
end
|
||||
|
||||
-- add all values.
|
||||
for k, v in pairs(tab) do
|
||||
if not first then
|
||||
res = res .. '\n'
|
||||
|
Reference in New Issue
Block a user