mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 10:45:42 +00:00
Fix TCF_RETURN_* flag propagation out of blocks (352197, r=mrbkap).
This commit is contained in:
parent
e3fe41e183
commit
0ab86235fe
@ -151,6 +151,7 @@ struct JSTreeContext { /* tree context for semantic checks */
|
||||
#define TCF_IN_FUNCTION 0x02 /* parsing inside function body */
|
||||
#define TCF_RETURN_EXPR 0x04 /* function has 'return expr;' */
|
||||
#define TCF_RETURN_VOID 0x08 /* function has 'return;' */
|
||||
#define TCF_RETURN_FLAGS 0x0C /* propagate these out of blocks */
|
||||
#define TCF_IN_FOR_INIT 0x10 /* parsing init expr of for; exclude 'in' */
|
||||
#define TCF_FUN_CLOSURE_VS_VAR 0x20 /* function and var with same name */
|
||||
#define TCF_FUN_USES_NONLOCALS 0x40 /* function refers to non-local names */
|
||||
|
@ -3405,7 +3405,7 @@ Statement(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
||||
(!tc->topStmt || tc->topStmt->type == STMT_BLOCK)) {
|
||||
pn->pn_extra |= PNX_NEEDBRACES;
|
||||
}
|
||||
tc->flags = oldflags | (tc->flags & TCF_FUN_FLAGS);
|
||||
tc->flags = oldflags | (tc->flags & (TCF_FUN_FLAGS | TCF_RETURN_FLAGS));
|
||||
return pn;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user