changeset 795:dd36eae6aa04

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 05 Sep 2016 16:32:55 -0600
parents f16c77ef0f4f
children 6b8ea0a9b7c9
files src/luan/LuanState.java src/luan/modules/JavaLuan.java
diffstat 2 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
diff -r f16c77ef0f4f -r dd36eae6aa04 src/luan/LuanState.java
--- a/src/luan/LuanState.java	Mon Sep 05 16:08:00 2016 -0600
+++ b/src/luan/LuanState.java	Mon Sep 05 16:32:55 2016 -0600
@@ -85,7 +85,7 @@
 			return tbl.get(this,key);
 		}
 		if( obj != null && java.ok )
-			return JavaLuan.__index(this,obj,key,false);
+			return JavaLuan.__index(this,obj,key);
 		throw new LuanException("attempt to index a " + Luan.type(obj) + " value" );
 	}
 
diff -r f16c77ef0f4f -r dd36eae6aa04 src/luan/modules/JavaLuan.java
--- a/src/luan/modules/JavaLuan.java	Mon Sep 05 16:08:00 2016 -0600
+++ b/src/luan/modules/JavaLuan.java	Mon Sep 05 16:32:55 2016 -0600
@@ -45,9 +45,7 @@
 			throw new LuanException("Java isn't allowed");
 	}
 
-	static final Object FAIL = new Object();
-
-	public static Object __index(LuanState luan,Object obj,Object key,boolean canReturnFail) throws LuanException {
+	public static Object __index(LuanState luan,Object obj,Object key) throws LuanException {
 		checkJava(luan);
 		Class cls;
 		if( obj instanceof Static ) {
@@ -107,8 +105,6 @@
 			}
 		}
 //System.out.println("invalid member '"+key+"' for java object: "+obj);
-		if( canReturnFail )
-			return FAIL;
 		throw new LuanException( "invalid index '"+key+"' for java "+cls );
 	}