Checking in mrbkap's patch for 349283, r=me.

This commit is contained in:
brendan%mozilla.org 2006-08-19 06:44:46 +00:00
parent 11ca8fa43a
commit 3d566f7776

View File

@ -2381,20 +2381,24 @@ LetBlock(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc, JSBool statement)
pn1->pn_kid = pn;
pn = pn1;
statement = JS_FALSE;
}
if (statement) {
pnlet->pn_right = Statements(cx, ts, tc);
if (!pnlet->pn_right)
return NULL;
MUST_MATCH_TOKEN(TOK_RC, JSMSG_CURLY_AFTER_LET);
} else {
/*
* Change pnblock's opcode to the variant that propagates the last
* result down after popping the block, and clear statement.
*/
pnblock->pn_op = JSOP_LEAVEBLOCKEXPR;
statement = JS_FALSE;
}
pnlet->pn_right = statement ? Statements(cx, ts, tc) : Expr(cx, ts, tc);
pnlet->pn_right = Expr(cx, ts, tc);
if (!pnlet->pn_right)
return NULL;
if (statement)
MUST_MATCH_TOKEN(TOK_RC, JSMSG_CURLY_AFTER_LET);
}
js_PopStatement(tc);
return pn;