Mercurial Hosting > luan
comparison src/luan/interp/UnmExpr.java @ 112:f5af13062b10
fix previous rev
git-svn-id: https://luan-java.googlecode.com/svn/trunk@113 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 23 May 2014 22:52:39 +0000 |
parents | 6ca02b188dba |
children |
comparison
equal
deleted
inserted
replaced
111:2428ecfed375 | 112:f5af13062b10 |
---|---|
20 if( n != null ) | 20 if( n != null ) |
21 return -n.doubleValue(); | 21 return -n.doubleValue(); |
22 LuanBit bit = luan.bit(se); | 22 LuanBit bit = luan.bit(se); |
23 LuanFunction fn = bit.getHandlerFunction("__unm",o); | 23 LuanFunction fn = bit.getHandlerFunction("__unm",o); |
24 if( fn != null ) { | 24 if( fn != null ) { |
25 return Luan.first(bit.call(fn,"__unm",o)); | 25 return Luan.first(bit.call(fn,"__unm",new Object[]{o})); |
26 } | 26 } |
27 throw bit.exception("attempt to perform arithmetic on a "+Luan.type(o)+" value"); | 27 throw bit.exception("attempt to perform arithmetic on a "+Luan.type(o)+" value"); |
28 } | 28 } |
29 } | 29 } |