mirror of
https://github.com/centau/vide.git
synced 2026-10-21 03:36:10 +00:00
Fix scope stack staying broken after a yield in strict mode
This commit is contained in:
parent
a4151bd41e
commit
6b7bbca811
2 changed files with 31 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue