comparison core/src/luan/LuanTable.java @ 511:e3fb9768dbb3

better error messages
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 22 May 2015 10:47:56 -0600
parents 2da0bcb979b5
children 8e51d6071b67
comparison
equal deleted inserted replaced
510:2da0bcb979b5 511:e3fb9768dbb3
133 if( obj instanceof String ) 133 if( obj instanceof String )
134 return StringLuan.__index(bit,(String)obj,key); 134 return StringLuan.__index(bit,(String)obj,key);
135 if( obj instanceof byte[] ) 135 if( obj instanceof byte[] )
136 return BinaryLuan.__index(bit,(byte[])obj,key); 136 return BinaryLuan.__index(bit,(byte[])obj,key);
137 if( obj != null && luan.hasJava() ) 137 if( obj != null && luan.hasJava() )
138 return JavaLuan.__index(bit,obj,key); 138 return JavaLuan.__index(bit,obj,key,false);
139 else if( bit.el==null ) 139 else if( bit.el==null )
140 throw bit.exception( "attempt to index a " + Luan.type(obj) + " value" ); 140 throw bit.exception( "attempt to index a " + Luan.type(obj) + " value" );
141 else 141 else
142 throw bit.exception( "attempt to index a " + Luan.type(obj) + " value in '"+bit.el.text()+"'" ); 142 throw bit.exception( "attempt to index a " + Luan.type(obj) + " value in '"+bit.el.text()+"'" );
143 } 143 }