Several details in code (e.g., moving a variable to the most inner
scope that encloses its uses), comments, parameter names, extra tests.
This commit is contained in:
Roberto Ierusalimschy
2020-02-27 12:59:22 -03:00
parent 9b7987a9d1
commit 6eb53b7526
13 changed files with 52 additions and 45 deletions

View File

@@ -649,6 +649,11 @@ t = debug.getinfo(1) -- main
assert(t.isvararg == true and t.nparams == 0 and t.nups == 1 and
debug.getupvalue(t.func, 1) == "_ENV")
t = debug.getinfo(math.sin) -- C function
assert(t.isvararg == true and t.nparams == 0 and t.nups == 0)
t = debug.getinfo(string.gmatch("abc", "a")) -- C closure
assert(t.isvararg == true and t.nparams == 0 and t.nups > 0)