fix(libs): pick up coa-ace3 9583952 (AceDB falsy-defaults PR #10 backport)

Re-sync after coa-ace3 9583952 backported WoWUIDev/Ace3 PR #10 which fixes
the AceDB-3.0 simple-value defaults metatable: previously falsy defaults
like ["*"] = false read back as nil because of `k2~=nil and v or nil`
short-circuiting. Now they round-trip correctly.
This commit is contained in:
2026-05-24 19:30:36 +02:00
parent ae98c7a545
commit 5de0660c7f
+9 -1
View File
@@ -111,7 +111,15 @@ local function copyDefaults(dest, src)
end
else
-- Values are not tables, so this is just a simple return
local mt = {__index = function(t,k2) return k2~=nil and v or nil end}
-- (PR #10 backport: the old `k2~=nil and v or nil` short-circuits to
-- nil whenever the default `v` itself is falsy — so `["*"] = false`
-- defaults silently became nil. Make the read explicit instead.)
local mt = {
__index = function(t,k2)
if k2 == nil then return nil end
return v
end,
}
setmetatable(dest, mt)
end
elseif type(v) == "table" then