Mercurial Hosting > luan
comparison src/luan/lib/StringLib.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 | d310ebf4d6e7 |
children |
comparison
equal
deleted
inserted
replaced
162:01e9707a2fb0 | 163:3c95a2291d64 |
---|---|
58 return obj instanceof String ? mt : null; | 58 return obj instanceof String ? mt : null; |
59 } | 59 } |
60 }; | 60 }; |
61 | 61 |
62 public static Object __index(LuanState luan,final String s,Object key) throws LuanException { | 62 public static Object __index(LuanState luan,final String s,Object key) throws LuanException { |
63 LuanTable mod = (LuanTable)luan.global().get("String"); | 63 LuanTable mod = (LuanTable)luan.loaded().get("String"); |
64 if( mod!=null ) { | 64 if( mod!=null ) { |
65 Object obj = mod.get(key); | 65 Object obj = mod.get(key); |
66 if( obj instanceof LuanFunction ) { | 66 if( obj instanceof LuanFunction ) { |
67 final LuanFunction fn = (LuanFunction)obj; | 67 final LuanFunction fn = (LuanFunction)obj; |
68 return new LuanFunction() { | 68 return new LuanFunction() { |