Mercurial Hosting > luan
comparison src/luan/lib/JavaLib.java @ 163:3c95a2291d64
make all module fns non-global and make global fns call module fns
git-svn-id: https://luan-java.googlecode.com/svn/trunk@164 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 20 Jun 2014 09:32:36 +0000 |
parents | 1de3e4a6e82d |
children |
comparison
equal
deleted
inserted
replaced
162:01e9707a2fb0 | 163:3c95a2291d64 |
---|---|
30 | 30 |
31 public static final LuanFunction LOADER = new LuanFunction() { | 31 public static final LuanFunction LOADER = new LuanFunction() { |
32 @Override public Object call(LuanState luan,Object[] args) { | 32 @Override public Object call(LuanState luan,Object[] args) { |
33 luan.addMetatableGetter(mg); | 33 luan.addMetatableGetter(mg); |
34 LuanTable module = new LuanTable(); | 34 LuanTable module = new LuanTable(); |
35 LuanTable global = luan.global(); | |
36 try { | 35 try { |
37 module.put( "class", new LuanJavaFunction(JavaLib.class.getMethod("getClass",LuanState.class,String.class),null) ); | 36 module.put( "class", new LuanJavaFunction(JavaLib.class.getMethod("getClass",LuanState.class,String.class),null) ); |
38 add( module, "proxy", LuanState.class, Static.class, LuanTable.class, Object.class ); | 37 add( module, "proxy", LuanState.class, Static.class, LuanTable.class, Object.class ); |
39 } catch(NoSuchMethodException e) { | 38 } catch(NoSuchMethodException e) { |
40 throw new RuntimeException(e); | 39 throw new RuntimeException(e); |