diff core/src/luan/LuanTable.java @ 578:60c549d43988

remove LuanState.exception()
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 14 Jul 2015 17:40:48 -0600
parents 7c3ad6db8ac3
children cdc70de628b5
line wrap: on
line diff
--- a/core/src/luan/LuanTable.java	Mon Jul 13 20:53:02 2015 -0600
+++ b/core/src/luan/LuanTable.java	Tue Jul 14 17:40:48 2015 -0600
@@ -160,7 +160,7 @@
 			tbl.put(luan,key,value);
 			return;
 		}
-		throw luan.exception("invalid type "+Luan.type(h)+" for metamethod __new_index");
+		throw new LuanException(luan,"invalid type "+Luan.type(h)+" for metamethod __new_index");
 	}
 
 	public void rawPut(Object key,Object val) {
@@ -319,14 +319,14 @@
 				LuanFunction fn = (LuanFunction)h;
 				Object obj = Luan.first(fn.call(luan,new Object[]{this}));
 				if( !(obj instanceof LuanFunction) )
-					throw luan.exception( "metamethod __pairs should return function but returned " + Luan.type(obj) );
+					throw new LuanException(luan, "metamethod __pairs should return function but returned " + Luan.type(obj) );
 				return (LuanFunction)obj;
 			}
 			if( h instanceof LuanMeta ) {
 				LuanMeta meta = (LuanMeta)h;
 				return meta.__pairs(luan,this);
 			}
-			throw luan.exception( "invalid type of metamethod __pairs: " + Luan.type(h) );
+			throw new LuanException(luan, "invalid type of metamethod __pairs: " + Luan.type(h) );
 		}
 		return rawPairs();
 	}