mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Add flag to disable deferral of nested properties
This commit is contained in:
parent
ccaeb030f3
commit
4c639f8388
4 changed files with 95 additions and 68 deletions
|
|
@ -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 {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue