| 33 | } |
| 34 | |
| 35 | @Override |
| 36 | public Object call(ExecutionContext context) { |
| 37 | |
| 38 | Arguments argsObj = (Arguments) context.resolve("arguments").getValue(context); |
| 39 | int numExtraArgs = (int) argsObj.get(context, "length"); |
| 40 | Object[] args = new Object[ this.boundArgs.length + numExtraArgs ]; |
| 41 | |
| 42 | System.arraycopy(this.boundArgs, 0, args, 0, this.boundArgs.length); |
| 43 | |
| 44 | for ( int i = 0 ; i < numExtraArgs ; ++i ) { |
| 45 | Object v = argsObj.get( context, "" + i ); |
| 46 | if ( v instanceof Reference ) { |
| 47 | v = ((Reference) v).getValue(context); |
| 48 | } |
| 49 | args[i + this.boundArgs.length ] = v; |
| 50 | } |
| 51 | |
| 52 | return context.call(this.target, this.boundThis, args); |
| 53 | } |
| 54 | |
| 55 | |
| 56 | /* |