Diff

util/debug.lua @ 4465:41c4252526bd

util.debug: Adjust level within get_locals_table() to account for the additional depth of this function itself
author Matthew Wild <mwild1@gmail.com>
date Fri, 13 Jan 2012 15:46:36 +0000
parent 4418:70b5e533325d
child 4519:510f4ba7080f
child 4680:8834f220ab91
line wrap: on
line diff
--- a/util/debug.lua	Fri Jan 06 21:45:33 2012 +0000
+++ b/util/debug.lua	Fri Jan 13 15:46:36 2012 +0000
@@ -9,6 +9,7 @@
 };
 
 local function get_locals_table(level)
+	level = level + 1; -- Skip this function itself
 	local locals = {};
 	for local_num = 1, math.huge do
 		local name, value = debug.getlocal(level, local_num);