Mercurial Hosting > luan
diff core/src/luan/modules/TableLuan.java @ 222:b76fcb72d97d
add AbstractLuanTable and improve HttpLuan
git-svn-id: https://luan-java.googlecode.com/svn/trunk@223 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 21 Jul 2014 02:23:05 +0000 |
parents | ec016471c6eb |
children | 8afe9f2fdfec |
line wrap: on
line diff
--- a/core/src/luan/modules/TableLuan.java Thu Jul 17 07:49:26 2014 +0000 +++ b/core/src/luan/modules/TableLuan.java Mon Jul 21 02:23:05 2014 +0000 @@ -21,9 +21,9 @@ LuanTable module = Luan.newTable(); try { add( module, "concat", LuanState.class, LuanTable.class, String.class, Integer.class, Integer.class ); - add( module, "insert", LuanState.class, LuanTable.class, Integer.TYPE, Object.class ); + add( module, "insert", LuanTable.class, Integer.TYPE, Object.class ); add( module, "pack", new Object[0].getClass() ); - add( module, "remove", LuanState.class, LuanTable.class, Integer.TYPE ); + add( module, "remove", LuanTable.class, Integer.TYPE ); add( module, "sort", LuanState.class, LuanTable.class, LuanFunction.class ); add( module, "sub_list", LuanTable.class, Integer.TYPE, Integer.TYPE ); add( module, "unpack", LuanTable.class, Integer.class, Integer.class ); @@ -56,20 +56,12 @@ return buf.toString(); } - public static void insert(LuanState luan,LuanTable list,int pos,Object value) throws LuanException { - try { - list.insert(pos,value); - } catch(IndexOutOfBoundsException e) { - throw luan.exception(e); - } + public static void insert(LuanTable list,int pos,Object value){ + list.insert(pos,value); } - public static Object remove(LuanState luan,LuanTable list,int pos) throws LuanException { - try { - return list.remove(pos); - } catch(IndexOutOfBoundsException e) { - throw luan.exception(e); - } + public static Object remove(LuanTable list,int pos) { + return list.remove(pos); } private static interface LessThan {