First "complete" implementation of to-be-closed variables

Still missing:
- handling of memory errors when creating upvalue (must run closing
method all the same)
- interaction with coroutines
This commit is contained in:
Roberto Ierusalimschy
2018-10-17 10:44:42 -03:00
parent 4cd1f4aac0
commit bd96330d03
13 changed files with 145 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
-- $Id: testes/api.lua $
-- $Id: testes/api.lua 2018-07-25 15:31:04 -0300 $
-- See Copyright Notice in file all.lua
if T==nil then
@@ -1027,6 +1027,18 @@ testamem("coroutine creation", function()
end)
-- testing to-be-closed variables
testamem("to-be-closed variables", function()
local flag
do
local scoped x = function () flag = true end
flag = false
local x = {}
end
return flag
end)
-- testing threads
-- get main thread from registry (at index LUA_RIDX_MAINTHREAD == 1)