diff core/src/luan/LuanBit.java @ 446:bbad2d06f728

remove automatic conversion from string to number
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 04 May 2015 16:21:17 -0600
parents bf5e62a9090c
children 30544d1a9cbf
line wrap: on
line diff
--- a/core/src/luan/LuanBit.java	Mon May 04 15:43:36 2015 -0600
+++ b/core/src/luan/LuanBit.java	Mon May 04 16:21:17 2015 -0600
@@ -53,9 +53,8 @@
 	}
 
 	public Number checkNumber(Object obj) throws LuanException {
-		Number n = Luan.toNumber(obj);
-		if( n != null )
-			return n;
+		if( obj instanceof Number )
+			return (Number)obj;
 		if( el instanceof LuanSource.Element ) {
 			LuanSource.Element se = (LuanSource.Element)el;
 			throw exception( "attempt to perform arithmetic on '"+se.text()+"' (a " + Luan.type(obj) + " value)" );
@@ -141,7 +140,7 @@
 		LuanFunction fn = getBinHandler(op,o1,o2);
 		if( fn != null )
 			return Luan.first(call(fn,op,new Object[]{o1,o2}));
-		String type = Luan.toNumber(o1)==null ? Luan.type(o1) : Luan.type(o2);
+		String type = !(o1 instanceof Number) ? Luan.type(o1) : Luan.type(o2);
 		throw exception("attempt to perform arithmetic on a "+type+" value");
 	}