comparison core/src/luan/modules/PickleServer.java @ 426:23a93c118042

fix LuanTable.get() to use metatables
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 01 May 2015 18:44:20 -0600
parents a1fa4fba99de
children dae264ad6a7b
comparison
equal deleted inserted replaced
425:0a2fb80907f9 426:23a93c118042
64 } catch(LuanException e2) { 64 } catch(LuanException e2) {
65 throw new RuntimeException(e2); 65 throw new RuntimeException(e2);
66 } 66 }
67 } 67 }
68 68
69 public void run() { 69 public void run() throws LuanException {
70 LuanTable io = (LuanTable)PackageLuan.loaded(con.luan).get("luan:Io"); 70 LuanTable io = (LuanTable)PackageLuan.require(con.luan,"luan:Io");
71 LuanTable env = con.env; 71 LuanTable env = con.env;
72 Object old_reverse_pickle = io.get("reverse_pickle"); 72 Object old_reverse_pickle = io.rawGet("reverse_pickle");
73 Object old_unreverse_pickle = env.get("_unreverse_pickle"); 73 Object old_unreverse_pickle = env.rawGet("_unreverse_pickle");
74 try { 74 try {
75 try { 75 try {
76 io.put("reverse_pickle", new LuanJavaFunction( 76 io.put("reverse_pickle", new LuanJavaFunction(
77 PickleServer.class.getMethod( "reverse_pickle", LuanFunction.class ), this 77 PickleServer.class.getMethod( "reverse_pickle", LuanFunction.class ), this
78 ) ); 78 ) );