Merge branch 'master' into nextversion
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
print "testing closures"
|
||||
|
||||
local A,B = 0,{g=10}
|
||||
function f(x)
|
||||
local function f(x)
|
||||
local a = {}
|
||||
for i=1,1000 do
|
||||
local y = 0
|
||||
@@ -86,6 +86,7 @@ assert(r == 2 and s == "a")
|
||||
|
||||
|
||||
-- testing closures with 'for' control variable x break
|
||||
local f
|
||||
for i=1,3 do
|
||||
f = function () return i end
|
||||
break
|
||||
@@ -136,7 +137,7 @@ assert(b('get') == 'xuxu')
|
||||
b('set', 10); assert(b('get') == 14)
|
||||
|
||||
|
||||
local w
|
||||
local y, w
|
||||
-- testing multi-level closure
|
||||
function f(x)
|
||||
return function (y)
|
||||
@@ -227,6 +228,7 @@ t()
|
||||
-- test for debug manipulation of upvalues
|
||||
local debug = require'debug'
|
||||
|
||||
local foo1, foo2, foo3
|
||||
do
|
||||
local a , b, c = 3, 5, 7
|
||||
foo1 = function () return a+b end;
|
||||
|
||||
Reference in New Issue
Block a user