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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user