diff src/luan/tools/web_run.luan @ 156:925ba2d59b9d

fix String java calls; improve web_run.luan; git-svn-id: https://luan-java.googlecode.com/svn/trunk@157 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 18 Jun 2014 08:16:50 +0000
parents 3b384dc5ca91
children 1de3e4a6e82d
line wrap: on
line diff
--- a/src/luan/tools/web_run.luan	Wed Jun 18 07:38:46 2014 +0000
+++ b/src/luan/tools/web_run.luan	Wed Jun 18 08:16:50 2014 +0000
@@ -17,11 +17,15 @@
 end
 
 function page()
-	Http.response.set_content_type "text/plain"
 	Io.stdout = Http.response.text_writer()
 	local code = Http.request.get_parameter "code"
+	local env = {
+		write = Io.stdout.write;
+		request = Http.request;
+		response = Http.response;
+	}
 	try
-		local fn = load(code,"<web_run>")
+		local fn = load(code,"<web_run>",env)
 		fn()
 	catch e do
 		print(e)