Fix scope stack staying broken after a yield in strict mode

This commit is contained in:
Kaan 2026-10-19 17:47:25 +03:00
parent a4151bd41e
commit 6b7bbca811
2 changed files with 31 additions and 1 deletions

View file

@ -3009,6 +3009,27 @@ TEST("strict", wrap_root(function()
CHECK(not ok)
end
do CASE "yield in a component"
local input = source(false)
local thread
local resumed = false
local destroy = root(function()
show(input, function()
thread = coroutine.running()
coroutine.yield()
resumed = true
return {}
end)
end)
CHECK(not pcall(input, true))
CHECK(not coroutine.resume(thread))
CHECK(not resumed)
CHECK(pcall(input, false))
CHECK(pcall(destroy))
end
do CASE "run derived callback twice"
local src = source(1)
local count = 0