We treat false as empty table if the default value is table

This commit is contained in:
hrsh7th
2021-08-29 21:33:45 +09:00
parent b29356a176
commit 684d862526
2 changed files with 7 additions and 2 deletions

View File

@@ -38,6 +38,11 @@ misc.merge = function(v1, v2)
if v1 == nil then
return v2
end
-- treat false as {} if the default value is table.
if merge2 and v1 == false then
return {}
end
return v1
end