comparison core/src/luan/LuanTable.java @ 497:55f9f74f1e55

Http.request is now pure luan
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 17 May 2015 19:25:47 -0600
parents 472fc70853cd
children ee55be414a34
comparison
equal deleted inserted replaced
496:c65df5b25932 497:55f9f74f1e55
280 try { 280 try {
281 Object obj = luan.call(fn); 281 Object obj = luan.call(fn);
282 if( obj==null ) 282 if( obj==null )
283 return null; 283 return null;
284 Object[] a = (Object[])obj; 284 Object[] a = (Object[])obj;
285 if( a.length == 0 ) 285 if( a.length == 0 || a[0]==null )
286 return null; 286 return null;
287 return new AbstractMap.SimpleEntry<Object,Object>(a[0],a[1]); 287 return new AbstractMap.SimpleEntry<Object,Object>(a[0],a[1]);
288 } catch(LuanException e) { 288 } catch(LuanException e) {
289 throw new LuanRuntimeException(e); 289 throw new LuanRuntimeException(e);
290 } 290 }
414 414
415 public void setJava() { 415 public void setJava() {
416 hasJava = true; 416 hasJava = true;
417 } 417 }
418 418
419
420 // from AbstractLuanTable
421
422 private Map<Object,Object> newMap() { 419 private Map<Object,Object> newMap() {
423 return new LinkedHashMap<Object,Object>(); 420 return new LinkedHashMap<Object,Object>();
424 } 421 }
425 422
426 public boolean isSet(LuanState luan) throws LuanException { 423 public boolean isSet(LuanState luan) throws LuanException {
445 map.put(entry.getKey(),entry.getValue()); 442 map.put(entry.getKey(),entry.getValue());
446 } 443 }
447 return map; 444 return map;
448 } 445 }
449 446
447 public void rawClear() {
448 map = null;
449 list = null;
450 }
451
450 } 452 }