mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 12:15:51 +00:00
Checking in mrbkap's patch for 349283, r=me.
This commit is contained in:
parent
11ca8fa43a
commit
3d566f7776
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user