diff core/src/luan/modules/BasicLuan.java @ 422:af82b266fe89

add Io.repr()
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 01 May 2015 16:13:52 -0600
parents 8fbb961aabd5
children 1eafb11a150d
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java	Fri May 01 15:13:14 2015 -0600
+++ b/core/src/luan/modules/BasicLuan.java	Fri May 01 16:13:52 2015 -0600
@@ -220,7 +220,7 @@
 		return obj instanceof LuanFunction ? (LuanFunction)obj : null;
 	}
 
-	public static void try_(LuanState luan,LuanTable blocks) throws LuanException {
+	public static Object try_(LuanState luan,LuanTable blocks) throws LuanException {
 		Utils.checkNotNull(luan,blocks);
 		Object obj = blocks.get(1);
 		if( obj == null )
@@ -243,11 +243,11 @@
 			finallyFn = (LuanFunction)obj;
 		}
 		try {
-			luan.call(tryFn);
+			return luan.call(tryFn);
 		} catch(LuanException e) {
 			if( catchFn == null )
 				throw e;
-			luan.call(catchFn,new Object[]{e});
+			return luan.call(catchFn,new Object[]{e});
 		} finally {
 			if( finallyFn != null )
 				luan.call(finallyFn);