Mercurial Hosting > luan
comparison src/luan/LuanState.java @ 74:f003338d503b
improve package lib
git-svn-id: https://luan-java.googlecode.com/svn/trunk@75 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Wed, 13 Feb 2013 06:27:56 +0000 |
parents | f86e4f77ef32 |
children | aa7538ae5fb6 |
comparison
equal
deleted
inserted
replaced
73:f86e4f77ef32 | 74:f003338d503b |
---|---|
26 | 26 |
27 private final List<MetatableGetter> mtGetters = new ArrayList<MetatableGetter>(); | 27 private final List<MetatableGetter> mtGetters = new ArrayList<MetatableGetter>(); |
28 final List<StackTraceElement> stackTrace = new ArrayList<StackTraceElement>(); | 28 final List<StackTraceElement> stackTrace = new ArrayList<StackTraceElement>(); |
29 | 29 |
30 | 30 |
31 public Object load(LuanFunction loader,String modName) throws LuanException { | 31 public void load(LuanFunction loader,String modName) throws LuanException { |
32 return load(loader,modName,null); | 32 Object mod = Luan.first(call(loader,LuanElement.JAVA,"loader",modName)); |
33 } | |
34 | |
35 public Object load(LuanFunction loader,String modName,Object extra) throws LuanException { | |
36 Object mod = Luan.first(call(loader,LuanElement.JAVA,"loader",modName,extra)); | |
37 if( mod == null ) | 33 if( mod == null ) |
38 mod = true; | 34 mod = true; |
39 loaded.put(modName,mod); | 35 loaded.put(modName,mod); |
40 return mod; | 36 if( mod instanceof LuanTable ) |
37 global.put(modName,mod); | |
41 } | 38 } |
42 | 39 |
43 public static LuanState newStandard() { | 40 public static LuanState newStandard() { |
44 try { | 41 try { |
45 LuanState luan = LuanCompiler.newLuanState(); | 42 LuanState luan = LuanCompiler.newLuanState(); |