Skip to content

Commit

Permalink
Ignore false passed as a child
Browse files Browse the repository at this point in the history
  • Loading branch information
centau committed Jan 4, 2025
1 parent c796e48 commit 46a2043
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/apply.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions test/tests.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 46a2043

Please sign in to comment.