break;
}
case LP: {
- int n = parseArgs(b, false);
+ int n = parseArgs(b);
- // if the object supports GETCALL, we use this, and jump over the following two instructions
+ // if the object supports CALLMETHOD, we use this, and jump over the following two instructions
b.add(parserLine,CALLMETHOD,new Integer(n));
b.add(parserLine,GET);
b.add(parserLine,CALL,new Integer(n));
switch (tok) {
case LP: { // invocation (not grouping)
- int n = parseArgs(b, true);
+ int n = parseArgs(b);
b.add(parserLine, CALL, new Integer(n));
break;
}
// parse a set of comma separated function arguments, assume LP has already been consumed
// if swap is true, (because the function is already on the stack) we will SWAP after each argument to keep it on top
- private int parseArgs(JSFunction b, boolean swap) throws IOException {
+ private int parseArgs(JSFunction b) throws IOException {
int i = 0;
while(peekToken() != RP) {
i++;
if (peekToken() != COMMA) {
startExpr(b, NO_COMMA);
- if (swap) b.add(parserLine, SWAP);
+ b.add(parserLine, SWAP, new Integer(2));
if (peekToken() == RP) break;
}
consume(COMMA);