Commit e44a31a2 authored by Petr Špaček's avatar Petr Špaček

table_print: simplification

As far as I understand the debug.sethook('call') descrption we are not
going to have any locals except function parameters so we can simplify
the code.
parent 4dfbec6c
......@@ -377,16 +377,12 @@ local function funcsign(f)
local function hook()
delay = delay - 1
if delay == 0 then -- call this only for the introspected function
for i = 1, math.huge do
-- stack depth 2 is the introspected function
-- stack depth 2 is the introspected function
local debuginfo = debug.getinfo(2)
for i = 1, debuginfo.nparams do
local k = debug.getlocal(2, i)
if (k or '('):sub(1, 1) == '(' then
break -- internal variable, skip
else
table.insert(func_args, k)
end
table.insert(func_args, k)
end
local debuginfo = debug.getinfo(2)
if debuginfo.what == 'C' then -- names N/A
table.insert(func_args, '?')
elseif debuginfo.isvararg then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment