don't fail if object doesn't match class types strictly
Some checks failed
binaries / linux (push) Has been cancelled
binaries / windows (push) Has been cancelled
spec / test (5.1) (push) Has been cancelled
spec / test (5.2) (push) Has been cancelled
spec / test (5.3) (push) Has been cancelled
spec / test (5.4) (push) Has been cancelled
spec / test (luajit) (push) Has been cancelled
spec / test (luajit-openresty) (push) Has been cancelled

This commit is contained in:
leaf corcoran 2024-12-01 09:27:02 -08:00
parent 60094ca0be
commit 3db3ec8234
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ dump = function(what)
end
seen[what] = false
local class_name
if what.__class then
if type(what.__class) == "table" and type(what.__class.__name) == "string" then
class_name = "<" .. tostring(what.__class.__name) .. ">"
end
return tostring(class_name or "") .. "{\n" .. concat(lines) .. (" "):rep((depth - 1) * 4) .. "}\n"

View File

@ -70,7 +70,7 @@ dump = (what) ->
seen[what] = false
class_name = if what.__class
class_name = if type(what.__class) == "table" and type(what.__class.__name) == "string"
"<#{what.__class.__name}>"
"#{class_name or ""}{\n" .. concat(lines) .. (" ")\rep((depth - 1)*4) .. "}\n"