diff core/src/luan/modules/Utils.java @ 251:705d14f4d8ee

start web testing git-svn-id: https://luan-java.googlecode.com/svn/trunk@252 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Sun, 19 Oct 2014 03:38:47 +0000
parents 97d175772fed
children 4dfa86dbca45
line wrap: on
line diff
--- a/core/src/luan/modules/Utils.java	Fri Oct 17 02:17:46 2014 +0000
+++ b/core/src/luan/modules/Utils.java	Sun Oct 19 03:38:47 2014 +0000
@@ -10,6 +10,7 @@
 import java.net.MalformedURLException;
 import luan.LuanState;
 import luan.LuanException;
+import luan.LuanTable;
 
 
 public final class Utils {
@@ -17,11 +18,23 @@
 
 	static final int bufSize = 8192;
 
-	public static void checkNotNull(LuanState luan,Object v,String expected) throws LuanException {
+	private static void checkNotNull(LuanState luan,Object v,String expected) throws LuanException {
 		if( v == null )
 			throw luan.exception("bad argument #1 ("+expected+" expected, got nil)");
 	}
 
+	public static void checkNotNull(LuanState luan,String s) throws LuanException {
+		checkNotNull(luan,s,"string");
+	}
+
+	public static void checkNotNull(LuanState luan,LuanTable t) throws LuanException {
+		checkNotNull(luan,t,"table");
+	}
+
+	public static void checkNotNull(LuanState luan,Number n) throws LuanException {
+		checkNotNull(luan,n,"number");
+	}
+
 	public static String readAll(Reader in)
 		throws IOException
 	{