aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-15 11:42:33 +0200
committerKim Alvefur <zash@zash.se>2017-10-15 11:42:33 +0200
commita545dd951d0cb707d0e8137263270545571864f7 (patch)
treec2693f0c86ad2a6ceefd7c0943303cb2de9523e1
parentcd07442625138fc611ebd9a9e913f015d6f9c1ac (diff)
downloadprosody-im-server-a545dd951d0cb707d0e8137263270545571864f7.zip
prosody-im-server-a545dd951d0cb707d0e8137263270545571864f7.tar
util.debug: Produce a sensible name for nameless upvalues to C functions
-rw-r--r--util/debug.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/debug.lua b/util/debug.lua
index 00f476d0..e736d0dd 100644
--- a/util/debug.lua
+++ b/util/debug.lua
@@ -47,6 +47,7 @@ local function get_upvalues_table(func)
for upvalue_num = 1, math.huge do
local name, value = debug.getupvalue(func, upvalue_num);
if not name then break; end
+ if name == "" then name = ("[%d]"):format(upvalue_num); end
table.insert(upvalues, { name = name, value = value });
end
end