Mercurial Hosting > luan
diff core/src/luan/modules/PickleClient.java @ 427:dae264ad6a7b
fix LuanTable.put() to use metatables
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 May 2015 19:29:07 -0600 |
parents | 23b99a5039b5 |
children | 60c549d43988 |
line wrap: on
line diff
--- a/core/src/luan/modules/PickleClient.java Fri May 01 18:44:20 2015 -0600 +++ b/core/src/luan/modules/PickleClient.java Fri May 01 19:29:07 2015 -0600 @@ -39,11 +39,11 @@ public Object call(Object... args) throws LuanException, IOException { con.write(args); Object[] result; - con.env.put("_reversed_pickle",_reversed_pickle); + con.env.rawPut("_reversed_pickle",_reversed_pickle); try { result = Luan.array(con.read()); } finally { - con.env.put("_reversed_pickle",null); + con.env.rawPut("_reversed_pickle",null); } boolean ok = (boolean)result[0]; if( ok ) { @@ -66,13 +66,13 @@ LuanTable table() { LuanTable tbl = new LuanTable(); try { - tbl.put( "pickle", new LuanJavaFunction( + tbl.rawPut( "pickle", new LuanJavaFunction( PickleCon.class.getMethod( "pickle", Object.class ), con ) ); - tbl.put( "call", new LuanJavaFunction( + tbl.rawPut( "call", new LuanJavaFunction( PickleClient.class.getMethod( "call", new Object[0].getClass() ), this ) ); - tbl.put( "close", new LuanJavaFunction( + tbl.rawPut( "close", new LuanJavaFunction( PickleCon.class.getMethod( "close" ), con ) ); } catch(NoSuchMethodException e) {