Complete implementation of to-be-closed variables
This commit is contained in:
@@ -734,19 +734,18 @@ a, b = coroutine.resume(co, 100)
|
||||
assert(a and b == 30)
|
||||
|
||||
|
||||
-- check traceback of suspended (or dead with error) coroutines
|
||||
-- check traceback of suspended coroutines
|
||||
|
||||
function f(i) if i==0 then error(i) else coroutine.yield(); f(i-1) end end
|
||||
function f(i) coroutine.yield(i == 0); f(i - 1) end
|
||||
|
||||
co = coroutine.create(function (x) f(x) end)
|
||||
a, b = coroutine.resume(co, 3)
|
||||
t = {"'coroutine.yield'", "'f'", "in function <"}
|
||||
while coroutine.status(co) == "suspended" do
|
||||
repeat
|
||||
checktraceback(co, t)
|
||||
a, b = coroutine.resume(co)
|
||||
table.insert(t, 2, "'f'") -- one more recursive call to 'f'
|
||||
end
|
||||
t[1] = "'error'"
|
||||
until b
|
||||
checktraceback(co, t)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user