Changeset

3027:b5beb7b15ac4

mod_console: Set a chunk name for loadstring calls (nicer errors).
author Waqas Hussain <waqas20@gmail.com>
date Fri, 07 May 2010 16:10:04 +0500
parents 3026:dec4527a7499
children 3028:e095d2a98936 3039:2fef108d7eb7
files plugins/mod_console.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_console.lua	Fri May 07 16:04:45 2010 +0500
+++ b/plugins/mod_console.lua	Fri May 07 16:10:04 2010 +0500
@@ -84,9 +84,10 @@
 
 			session.env._ = data;
 			
-			local chunk, err = loadstring("return "..data);
+			local chunkname = "=console";
+			local chunk, err = loadstring("return "..data, chunkname);
 			if not chunk then
-				chunk, err = loadstring(data);
+				chunk, err = loadstring(data, chunkname);
 				if not chunk then
 					err = err:gsub("^%[string .-%]:%d+: ", "");
 					err = err:gsub("^:%d+: ", "");