Bug 461110 - Extra parens in decompilation of "a += b = 3". r=brendan.

This commit is contained in:
Jason Orendorff
2008-10-22 14:26:49 -05:00
parent f0bf0f5ee2
commit 130070cd97

View File

@@ -2019,20 +2019,21 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
* problem).
*/
op = (JSOp) pc[oplen];
LOCAL_ASSERT(op != saveop);
}
rval = POP_STR_PREC(cs->prec + (!inXML && !!(cs->format & JOF_LEFTASSOC)));
lval = POP_STR_PREC(cs->prec + (!inXML && !(cs->format & JOF_LEFTASSOC)));
if (op != saveop) {
rval = POP_STR();
lval = POP_STR();
/* Print only the right operand of the assignment-op. */
todo = SprintCString(&ss->sprinter, rval);
op = saveop;
} else if (!inXML) {
rval = POP_STR_PREC(cs->prec + !!(cs->format & JOF_LEFTASSOC));
lval = POP_STR_PREC(cs->prec + !(cs->format & JOF_LEFTASSOC));
todo = Sprint(&ss->sprinter, "%s %s %s",
lval, token, rval);
} else {
/* In XML, just concatenate the two operands. */
LOCAL_ASSERT(op == JSOP_ADD);
rval = POP_STR();
lval = POP_STR();
todo = Sprint(&ss->sprinter, ss_format, lval, rval);
}
break;