Mercurial Hosting > luan
diff core/src/luan/modules/BasicLuan.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 | 1eafb11a150d |
children | dae264ad6a7b |
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java Fri May 01 17:18:23 2015 -0600 +++ b/core/src/luan/modules/BasicLuan.java Fri May 01 18:44:20 2015 -0600 @@ -106,7 +106,7 @@ } public static Object raw_get(LuanTable table,Object index) { - return table.get(index); + return table.rawGet(index); } public static LuanTable raw_set(LuanTable table,Object index,Object value) { @@ -218,21 +218,21 @@ public static Object try_(LuanState luan,LuanTable blocks) throws LuanException { Utils.checkNotNull(luan,blocks); - Object obj = blocks.get(1); + Object obj = blocks.get(luan,1); if( obj == null ) throw luan.exception("missing 'try' value"); if( !(obj instanceof LuanFunction) ) throw luan.exception("bad 'try' value (function expected, got "+Luan.type(obj)+")"); LuanFunction tryFn = (LuanFunction)obj; LuanFunction catchFn = null; - obj = blocks.get("catch"); + obj = blocks.get(luan,"catch"); if( obj != null ) { if( !(obj instanceof LuanFunction) ) throw luan.exception("bad 'catch' value (function expected, got "+Luan.type(obj)+")"); catchFn = (LuanFunction)obj; } LuanFunction finallyFn = null; - obj = blocks.get("finally"); + obj = blocks.get(luan,"finally"); if( obj != null ) { if( !(obj instanceof LuanFunction) ) throw luan.exception("bad 'finally' value (function expected, got "+Luan.type(obj)+")");