diff core/src/luan/modules/BasicLuan.java @ 502:d3183a330ff5

improve the __index metamethod to work with any type; simplify luan_proxy to eliminate base;
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 19 May 2015 17:57:20 -0600
parents 4dc9cb26a3a8
children 8dcf9e12446b
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java	Mon May 18 23:23:01 2015 -0600
+++ b/core/src/luan/modules/BasicLuan.java	Tue May 19 17:57:20 2015 -0600
@@ -64,7 +64,8 @@
 		};
 	}
 
-	public static Object get_metatable(LuanTable table) {
+	public static Object get_metatable(LuanState luan,LuanTable table) throws LuanException {
+		Utils.checkNotNull(luan,table);
 		LuanTable metatable = table.getMetatable();
 		if( metatable == null )
 			return null;
@@ -73,6 +74,7 @@
 	}
 
 	public static void set_metatable(LuanState luan,LuanTable table,LuanTable metatable) throws LuanException {
+		Utils.checkNotNull(luan,table);
 		if( table.getHandler("__metatable") != null )
 			throw luan.exception("cannot change a protected metatable");
 		table.setMetatable(metatable);