}
case CALL: case CALLMETHOD: {
- JS[] jsargs = (JS[])arg;
+ // FIXME: can a lot of simple cases in Parser be
+ // reduced so creating a new JS[] is not necessary?
+ JS[] jsargs;
+ if (arg instanceof JSNumber.I) {
+ jsargs = new JS[((JSNumber.I)arg).toInt()];
+ for (int i=0; i < jsargs.length; i++) jsargs[i] = (JS)stack.pop();
+ } else jsargs = (JS[])arg;
JS method = null;
JS ret = null;
JS key = (JS)stack.pop();
JS js = (JS)stack.peek();
// A trap addition/removal
- if(!(val instanceof JSFunction)) throw new JSExn("tried to add/remove a non-function trap");
+ if(!(val instanceof JSFunction)) throw new JSExn("tried to add/remove a non-function trap"); // FIXME
if(op == ADD_TRAP) js.addTrap(key, val);
else js.delTrap(key, val);
break;
*/
void catchException(JSExn e) throws JSExn {
while(!stack.empty()) {
- JS o = (JS)stack.pop();
+ Object o = stack.pop();
if (o instanceof CatchMarker || o instanceof TryMarker) {
boolean inCatch = o instanceof CatchMarker;
if(inCatch) {