Add flag to disable deferral of nested properties

This commit is contained in:
aaron 2024-12-26 22:36:58 +00:00
parent ccaeb030f3
commit 4c639f8388
4 changed files with 95 additions and 68 deletions

View file

@ -759,18 +759,35 @@ TEST("create()", wrap_root(function()
CHECK(text.Text == "test")
end
do CASE "nested precedence"
do CASE "nested deferred"
local text = create "TextLabel" {
{
{ Text = "2" },
Text = "1",
{ Text = "2" }
}
}
CHECK(text.Text == "2")
end
do CASE "nested not deferred"
vide.defer_nested_properties = false
local t = {}
create "TextLabel" {
{
{ function() table.insert(t, 1) end } :: any,
function() table.insert(t, 2) end,
}
}
CHECK(t[1] == 1)
CHECK(t[2] == 2)
vide.defer_nested_properties = true
end
do CASE "independent"
local frame = create "Frame"
CHECK(frame {} ~= frame {})