Skip to content

Commit

Permalink
lib.equal: do not compare tables with metatables
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Nov 15, 2022
1 parent 1145275 commit 264bd6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/lib.lua
Expand Up @@ -20,6 +20,8 @@ function equal (x, y)
elseif x == y then
return true
elseif type(x) == 'table' then
if getmetatable(x) then return false end
if getmetatable(y) then return false end
for k, v in pairs(x) do
if not equal(v, y[k]) then return false end
end
Expand Down

0 comments on commit 264bd6a

Please sign in to comment.