Dash.join fails to update mixed arrays properly, leading to unexpected behavior when using join to assign values.
Reproduction
local array = { 0, 0, 0 }
local changed = {} -- Must construct like this for it to fail
changed[1] = 1
changed[3] = 1
-- Expected: { 1, 0, 1 }
-- Actual: { 1, 0, 0 }
print(Dash.join(array, changed))
-- Root cause: iterator() implementation checks `#changed > 0` to see if it is an array, and
-- if it does, uses ipairs
print("#changed", #changed)
for key, value in ipairs(changed) do
print("this will only print once, not twice")
end
Dash.join fails to update mixed arrays properly, leading to unexpected behavior when using join to assign values.
Reproduction