comparison core/src/luan/LuanBit.java @ 440:93e6e67768d7

remove Luan.asString()
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 04 May 2015 11:34:38 -0600
parents f28320fd671d
children bf5e62a9090c
comparison
equal deleted inserted replaced
439:057c10f55f72 440:93e6e67768d7
40 stackTrace.remove(stackTrace.size()-1); 40 stackTrace.remove(stackTrace.size()-1);
41 } 41 }
42 } 42 }
43 43
44 public String checkString(Object obj) throws LuanException { 44 public String checkString(Object obj) throws LuanException {
45 String s = Luan.asString(obj); 45 if( obj instanceof String )
46 if( s != null ) 46 return (String)obj;
47 return s;
48 if( el instanceof LuanSource.Element ) { 47 if( el instanceof LuanSource.Element ) {
49 LuanSource.Element se = (LuanSource.Element)el; 48 LuanSource.Element se = (LuanSource.Element)el;
50 throw exception( "attempt to use '"+se.text()+"' (a " + Luan.type(obj) + " value) as a string" ); 49 throw exception( "attempt to use '"+se.text()+"' (a " + Luan.type(obj) + " value) as a string" );
51 } else { 50 } else {
52 throw exception( "attempt to use a " + Luan.type(obj) + " as a string" ); 51 throw exception( "attempt to use a " + Luan.type(obj) + " as a string" );