diff core/src/luan/LuanPropertyMeta.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 91af5337b9ae
children dae264ad6a7b
line wrap: on
line diff
--- a/core/src/luan/LuanPropertyMeta.java	Fri May 01 17:18:23 2015 -0600
+++ b/core/src/luan/LuanPropertyMeta.java	Fri May 01 18:44:20 2015 -0600
@@ -10,19 +10,19 @@
 	private LuanPropertyMeta() {}
 
 	public LuanTable getters(LuanTable tbl) {
-		return (LuanTable)tbl.getMetatable().get("get");
+		return (LuanTable)tbl.getMetatable().rawGet("get");
 	}
 
 	public LuanTable setters(LuanTable tbl) {
-		return (LuanTable)tbl.getMetatable().get("set");
+		return (LuanTable)tbl.getMetatable().rawGet("set");
 	}
 
 	protected String type(LuanTable tbl) {
-		return (String)tbl.getMetatable().get("type");
+		return (String)tbl.getMetatable().rawGet("type");
 	}
 
 	@Override public Object __index(LuanState luan,LuanTable tbl,Object key) throws LuanException {
-		Object obj = getters(tbl).get(key);
+		Object obj = getters(tbl).rawGet(key);
 		if( obj == null )
 			return null;
 		if( !(obj instanceof LuanFunction) )
@@ -53,7 +53,7 @@
 	}
 
 	@Override public void __newindex(LuanState luan,LuanTable tbl,Object key,Object value) throws LuanException {
-		Object obj = setters(tbl).get(key);
+		Object obj = setters(tbl).rawGet(key);
 		if( obj == null )
 			throw luan.exception("can't set property '"+key+"'");
 		if( !(obj instanceof LuanFunction) )