From c709121ca74a693c6f0feca0cdb03d5b50bd630c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 15 Oct 2017 11:42:33 +0200 Subject: util.debug: Produce a sensible name for nameless upvalues to C functions --- util/debug.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'util') 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 -- cgit v1.2.3