diff core/src/luan/modules/BasicLuan.java @ 572:f1601a4ce1aa

fix stack when calling meta-methods
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 12 Jul 2015 21:34:23 -0600
parents 5fed3de0aac7
children 6cc2f047019b
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java	Wed Jul 08 23:10:52 2015 -0600
+++ b/core/src/luan/modules/BasicLuan.java	Sun Jul 12 21:34:23 2015 -0600
@@ -45,7 +45,7 @@
 
 	public static LuanFunction pairs(final LuanState luan,final LuanTable t) throws LuanException {
 		Utils.checkNotNull(luan,t);
-		return t.pairs(luan);
+		return t.pairs(luan.JAVA);
 	}
 
 	public static LuanFunction ipairs(LuanState luan,final LuanTable t) throws LuanException {
@@ -105,7 +105,7 @@
 	}
 
 	public static String to_string(LuanState luan,Object v) throws LuanException {
-		return luan.toString(v);
+		return luan.JAVA.toString(v);
 	}
 
 	public static LuanTable new_error(LuanState luan,Object msg) throws LuanException {
@@ -183,21 +183,21 @@
 
 	public static Object try_(LuanState luan,LuanTable blocks) throws LuanException {
 		Utils.checkNotNull(luan,blocks);
-		Object obj = blocks.get(luan,1);
+		Object obj = blocks.get(luan.JAVA,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(luan,"catch");
+		obj = blocks.get(luan.JAVA,"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(luan,"finally");
+		obj = blocks.get(luan.JAVA,"finally");
 		if( obj != null ) {
 			if( !(obj instanceof LuanFunction) )
 				throw luan.exception("bad 'finally' value (function expected, got "+Luan.type(obj)+")");