Mercurial Hosting > luan
diff core/src/luan/modules/IoLuan.java @ 296:7ea6dfdf81ba
add env param to load_file()
git-svn-id: https://luan-java.googlecode.com/svn/trunk@297 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 15 Dec 2014 08:03:32 +0000 |
parents | a50e88d3547c |
children | 899253043270 |
line wrap: on
line diff
--- a/core/src/luan/modules/IoLuan.java Fri Dec 12 09:45:13 2014 +0000 +++ b/core/src/luan/modules/IoLuan.java Mon Dec 15 08:03:32 2014 +0000 @@ -207,10 +207,10 @@ return blocks(inputStream(),n); } - public LuanFunction loader(LuanState luan,String name) throws LuanException { + public LuanFunction loader(LuanState luan,String name,LuanTable env) throws LuanException { try { String src = read_text(); - return BasicLuan.load(luan,src,name,null,false); + return BasicLuan.load(luan,src,name,env,false); } catch(FileNotFoundException e) { return null; } catch(IOException e) { @@ -246,7 +246,7 @@ LuanIn.class.getMethod( "read_blocks", Integer.class ), this ) ); tbl.put( "loader", new LuanJavaFunction( - LuanIn.class.getMethod( "loader", LuanState.class, String.class ), this + LuanIn.class.getMethod( "loader", LuanState.class, String.class, LuanTable.class ), this ) ); tbl.put( "exists", new LuanJavaFunction( LuanIn.class.getMethod( "exists" ), this