Changeset

8322:cd15fc505b62

util.debug: Produce a sensible name for nameless upvalues to C functions
author Kim Alvefur <zash@zash.se>
date Sun, 15 Oct 2017 11:42:33 +0200
parents 8321:73ff49a42ea8
children 8323:f2c1d65f706b
files util/debug.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/debug.lua	Fri Oct 13 19:55:33 2017 +0200
+++ b/util/debug.lua	Sun Oct 15 11:42:33 2017 +0200
@@ -47,6 +47,7 @@
 		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