зеркало из https://github.com/mozilla/pjs.git
Don't call js_PopStatement if there was a parse error. bug 410852, r=brendan
This commit is contained in:
Родитель
fb16f302e2
Коммит
52be66aaa9
|
@ -881,17 +881,17 @@ FunctionBody(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
|
|||
pn = Statements(cx, ts, tc);
|
||||
#endif
|
||||
|
||||
js_PopStatement(tc);
|
||||
|
||||
/* Check for falling off the end of a function that returns a value. */
|
||||
if (pn && JS_HAS_STRICT_OPTION(cx) && (tc->flags & TCF_RETURN_EXPR)) {
|
||||
if (!CheckFinalReturn(cx, tc, pn))
|
||||
pn = NULL;
|
||||
}
|
||||
|
||||
if (pn)
|
||||
if (pn) {
|
||||
js_PopStatement(tc);
|
||||
pn->pn_pos.begin.lineno = firstLine;
|
||||
|
||||
/* Check for falling off the end of a function that returns a value. */
|
||||
if (JS_HAS_STRICT_OPTION(cx) && (tc->flags & TCF_RETURN_EXPR) &&
|
||||
!CheckFinalReturn(cx, tc, pn)) {
|
||||
pn = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
tc->flags = oldflags | (tc->flags & (TCF_FUN_FLAGS | TCF_HAS_DEFXMLNS));
|
||||
return pn;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче