summaryrefslogtreecommitdiff
path: root/testes/coroutine.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-05-09 12:10:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-05-09 12:10:31 -0300
commitd881325c2fcbb6d2c434ec403b0bbe51ac200c7b (patch)
tree811c1a1ffa8f91693b8df64e040c509c2cec6ded /testes/coroutine.lua
parent3f253f116e8e292977a1bded964544fb35b3d1e3 (diff)
downloadlua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.tar.gz
lua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.tar.bz2
lua-d881325c2fcbb6d2c434ec403b0bbe51ac200c7b.zip
Flag for to-be-closed variables changed to '<toclose>'
The flag for to-be-closed variables was changed from '*toclose' to '<toclose>'. Several people found confusing the old syntax and the new one has a clear terminator, making it more flexible for future changes.
Diffstat (limited to 'testes/coroutine.lua')
-rw-r--r--testes/coroutine.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua
index 9dd501e7..db6d074e 100644
--- a/testes/coroutine.lua
+++ b/testes/coroutine.lua
@@ -151,7 +151,7 @@ do
151 end 151 end
152 152
153 co = coroutine.create(function () 153 co = coroutine.create(function ()
154 local *toclose x = func2close(function (self, err) 154 local <toclose> x = func2close(function (self, err)
155 assert(err == nil); X = false 155 assert(err == nil); X = false
156 end) 156 end)
157 X = true 157 X = true
@@ -164,7 +164,7 @@ do
164 164
165 -- error killing a coroutine 165 -- error killing a coroutine
166 co = coroutine.create(function() 166 co = coroutine.create(function()
167 local *toclose x = func2close(function (self, err) 167 local <toclose> x = func2close(function (self, err)
168 assert(err == nil); error(111) 168 assert(err == nil); error(111)
169 end) 169 end)
170 coroutine.yield() 170 coroutine.yield()
@@ -348,7 +348,7 @@ do
348 348
349 local X = false 349 local X = false
350 A = coroutine.wrap(function() 350 A = coroutine.wrap(function()
351 local *toclose _ = setmetatable({}, {__close = function () X = true end}) 351 local <toclose> _ = setmetatable({}, {__close = function () X = true end})
352 return pcall(A, 1) 352 return pcall(A, 1)
353 end) 353 end)
354 st, res = A() 354 st, res = A()