mirror of
https://github.com/lua/lua.git
synced 2026-06-08 08:03:49 +00:00
Functions with vararg tables don't need hidden args.
Vararg functions with vararg tables don't use the arguments hidden in the stack; therfore, it doesn't need to build/keep them.
This commit is contained in:
@@ -726,6 +726,9 @@ assert(t.isvararg == false and t.nparams == 3 and t.nups == 0)
|
||||
t = debug.getinfo(function (a,b,...) return t[a] end, "u")
|
||||
assert(t.isvararg == true and t.nparams == 2 and t.nups == 1)
|
||||
|
||||
t = debug.getinfo(function (a,b,...t) t.n = 2; return t[a] end, "u")
|
||||
assert(t.isvararg == true and t.nparams == 2 and t.nups == 0)
|
||||
|
||||
t = debug.getinfo(1) -- main
|
||||
assert(t.isvararg == true and t.nparams == 0 and t.nups == 1 and
|
||||
debug.getupvalue(t.func, 1) == "_ENV")
|
||||
|
||||
Reference in New Issue
Block a user