Evaluate the declaration of the method. That is, determine the structure of the method and install it into the caller's namespace.
( CallStack callstack, Interpreter interpreter )
| 108 | structure of the method and install it into the caller's namespace. |
| 109 | */ |
| 110 | public Object eval( CallStack callstack, Interpreter interpreter ) |
| 111 | throws EvalError |
| 112 | { |
| 113 | returnType = evalReturnType( callstack, interpreter ); |
| 114 | evalNodes( callstack, interpreter ); |
| 115 | |
| 116 | // Install an *instance* of this method in the namespace. |
| 117 | // See notes in BshMethod |
| 118 | |
| 119 | // This is not good... |
| 120 | // need a way to update eval without re-installing... |
| 121 | // so that we can re-eval params, etc. when classloader changes |
| 122 | // look into this |
| 123 | |
| 124 | NameSpace namespace = callstack.top(); |
| 125 | BshMethod bshMethod = new BshMethod( this, namespace, modifiers ); |
| 126 | try { |
| 127 | namespace.setMethod( bshMethod ); |
| 128 | } catch ( UtilEvalError e ) { |
| 129 | throw e.toEvalError(this,callstack); |
| 130 | } |
| 131 | |
| 132 | return Primitive.VOID; |
| 133 | } |
| 134 | |
| 135 | private void evalNodes( CallStack callstack, Interpreter interpreter ) |
| 136 | throws EvalError |
nothing calls this directly
no test coverage detected