( CallStack callstack, Interpreter interpreter)
| 34 | BSHUnaryExpression(int id) { super(id); } |
| 35 | |
| 36 | public Object eval( CallStack callstack, Interpreter interpreter) |
| 37 | throws EvalError |
| 38 | { |
| 39 | SimpleNode node = (SimpleNode)jjtGetChild(0); |
| 40 | |
| 41 | // If this is a unary increment of decrement (either pre or postfix) |
| 42 | // then we need an LHS to which to assign the result. Otherwise |
| 43 | // just do the unary operation for the value. |
| 44 | try { |
| 45 | if ( kind == INCR || kind == DECR ) { |
| 46 | LHS lhs = ((BSHPrimaryExpression)node).toLHS( |
| 47 | callstack, interpreter ); |
| 48 | return lhsUnaryOperation( lhs, interpreter.getStrictJava() ); |
| 49 | } else |
| 50 | return |
| 51 | unaryOperation( node.eval(callstack, interpreter), kind ); |
| 52 | } catch ( UtilEvalError e ) { |
| 53 | throw e.toEvalError( this, callstack ); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | private Object lhsUnaryOperation( LHS lhs, boolean strictJava ) |
| 58 | throws UtilEvalError |
nothing calls this directly
no test coverage detected