Bug 474236 - Only throw errors when we have to. r=brendan

This commit is contained in:
Blake Kaplan 2009-01-20 16:31:10 -08:00
parent 25c8ed99e7
commit 5f7e26cdd5

View File

@ -1446,10 +1446,15 @@ Statements(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc)
ts->flags |= TSF_OPERAND;
tt = js_PeekToken(cx, ts);
ts->flags &= ~TSF_OPERAND;
if (tt == TOK_RC)
if (tt <= TOK_EOF || tt == TOK_RC) {
if (tt == TOK_ERROR) {
if (ts->flags & TSF_EOF)
ts->flags |= TSF_UNEXPECTED_EOF;
return NULL;
}
break;
}
pn2 = Statement(cx, ts, tc);
JS_ASSERT_IF(tt == TOK_ERROR, !pn2);
if (!pn2) {
if (ts->flags & TSF_EOF)
ts->flags |= TSF_UNEXPECTED_EOF;