Ignore false passed as a child

This commit is contained in:
aaron 2025-01-04 00:45:55 +00:00
parent c796e48173
commit 46a2043356
3 changed files with 16 additions and 1 deletions

View file

@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
impulse.
- `show()` now receives a source to its callback returning the current value
of the condition.
- Ignore `false` passed as a child.
### Changed

View file

@ -93,7 +93,7 @@ local function process_properties(properties: Map<unknown, unknown>, instance: I
else
process_properties(value :: Map<unknown, unknown>, instance, cache, depth + 1)
end
else
elseif type(value) == "userdata" then
(value :: Instance).Parent = instance -- parent child
end
end

View file

@ -819,6 +819,20 @@ TEST("create()", wrap_root(function()
CHECK(frame:FindFirstChild "G")
end
do CASE "set false as child"
create "Frame" {
false
}
create "Frame" {
function() return false end
}
create "Frame" {
function() return { false } end
}
end
do CASE "binding properties to source"
local name = source("Hi")
local text = source("Bye")