mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
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.
This commit is contained in:
parent
3f253f116e
commit
d881325c2f
8 changed files with 40 additions and 38 deletions
|
|
@ -1137,7 +1137,8 @@ end)
|
|||
testamem("to-be-closed variables", function()
|
||||
local flag
|
||||
do
|
||||
local *toclose x = setmetatable({}, {__close = function () flag = true end})
|
||||
local <toclose> x =
|
||||
setmetatable({}, {__close = function () flag = true end})
|
||||
flag = false
|
||||
local x = {}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue