From 2c25f56ac8b47542dec1267416c9d0cf13ee61cf Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 24 May 2022 10:42:43 +0800 Subject: fix spec. --- spec/outputs/metatable.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'spec/outputs/metatable.lua') diff --git a/spec/outputs/metatable.lua b/spec/outputs/metatable.lua index 16ae86c..935202c 100644 --- a/spec/outputs/metatable.lua +++ b/spec/outputs/metatable.lua @@ -25,11 +25,13 @@ local w = setmetatable({ }, { end }) getmetatable(w)["new"](getmetatable(w)[name]) -local _ = setmetatable({ }, { - __close = function() - return print("out of scope") - end -}) +do + local _ = setmetatable({ }, { + __close = function() + return print("out of scope") + end + }) +end local d, e = a.close, getmetatable(a).__close local f = getmetatable(a):__close(1) getmetatable(a).__add = function(x, y) @@ -63,7 +65,7 @@ end setmetatable(a.b, { }) x.abc = 123 setmetatable(func(), mt) -_ = extra +local _ = extra setmetatable(b.c, mt) a, d, e = 1, "abc" local is_same = getmetatable(a).__index == getmetatable(a).__index -- cgit v1.2.3-55-g6feb