diff core/src/luan/LuanTable.java @ 428:df95199ca4c0

rename __newindex to __new_index
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 02 May 2015 20:10:31 -0600
parents dae264ad6a7b
children f28320fd671d
line wrap: on
line diff
--- a/core/src/luan/LuanTable.java	Fri May 01 19:29:07 2015 -0600
+++ b/core/src/luan/LuanTable.java	Sat May 02 20:10:31 2015 -0600
@@ -127,19 +127,19 @@
 	}
 
 	public void put(LuanState luan,Object key,Object value) throws LuanException {
-		Object h = getHandler("__newindex");
+		Object h = getHandler("__new_index");
 		if( h==null || rawGet(key)!=null ) {
 			rawPut(key,value);
 			return;
 		}
 		if( h instanceof LuanFunction ) {
 			LuanFunction fn = (LuanFunction)h;
-			luan.call(fn,"__newindex",new Object[]{this,key,value});
+			luan.call(fn,"__new_index",new Object[]{this,key,value});
 			return;
 		}
 		if( h instanceof LuanMeta ) {
 			LuanMeta meta = (LuanMeta)h;
-			meta.__newindex(luan,this,key,value);
+			meta.__new_index(luan,this,key,value);
 			return;
 		}
 		if( h instanceof LuanTable ) {
@@ -147,7 +147,7 @@
 			tbl.put(luan,key,value);
 			return;
 		}
-		throw luan.exception("invalid type "+Luan.type(h)+" for metamethod __newindex");
+		throw luan.exception("invalid type "+Luan.type(h)+" for metamethod __new_index");
 	}
 
 	public void rawPut(Object key,Object val) {