diff http/src/luan/modules/http/Shell_mod.luan @ 694:b620b8e1010f

remove Luan.load() allow_expression param and add Luan.eval()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 20 Apr 2016 20:56:08 -0600
parents ca169567ce07
children
line wrap: on
line diff
--- a/http/src/luan/modules/http/Shell_mod.luan	Tue Apr 19 15:54:11 2016 -0600
+++ b/http/src/luan/modules/http/Shell_mod.luan	Wed Apr 20 20:56:08 2016 -0600
@@ -30,13 +30,21 @@
 			print( "% "..cmd )
 			try {
 				function()
-					local line = load(cmd,"<web_shell>",M.env,true)
+					local line
+					try {
+						function()
+							line = load("return "..cmd,"<web_shell>",M.env)
+						end
+						catch = function(e)
+							line = load(cmd,"<web_shell>",M.env)
+						end
+					}
 					print( line() )
-				end;
+				end
 				catch = function(e)
 					Io.print_to(Io.stderr,e)
 					print(e)
-				end;
+				end
 			}
 		end
 	end