Fix yield nothing and yield yield parsing (345855, r=mrbkap).

This commit is contained in:
brendan%mozilla.org 2006-07-31 19:23:46 +00:00
Родитель 150b1764c7
Коммит f5b60c5b14
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -2009,7 +2009,11 @@ ReturnOrYield(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc,
if (tt2 == TOK_ERROR)
return NULL;
if (tt2 != TOK_EOF && tt2 != TOK_EOL && tt2 != TOK_SEMI && tt2 != TOK_RC) {
if (tt2 != TOK_EOF && tt2 != TOK_EOL && tt2 != TOK_SEMI && tt2 != TOK_RC
#if JS_HAS_GENERATORS
&& (tt != TOK_YIELD || (tt2 != tt && tt2 != TOK_RB && tt2 != TOK_RP))
#endif
) {
pn2 = operandParser(cx, ts, tc);
if (!pn2)
return NULL;