Parallel fix to SpiderMonkey's bug 238945, to automatically insert ; after do-while on any error token.

This commit is contained in:
brendan%mozilla.org 2004-03-30 03:25:17 +00:00
Родитель 73ca7a66e9
Коммит 8dcdcb1f89
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -425,6 +425,13 @@ function Statement(t, x) {
n.isLoop = true;
n.body = nest(t, x, n, Statement, WHILE);
n.condition = ParenExpression(t, x);
if (!x.ecmaStrictMode) {
// <script language="JavaScript"> (without version hints) may need
// automatic semicolon insertion without a newline after do-while.
// See http://bugzilla.mozilla.org/show_bug.cgi?id=238945.
t.match(SEMICOLON);
return n;
}
break;
case BREAK:
@ -723,8 +730,8 @@ loop:
operators.push(new Node(t));
if (tt == ASSIGN)
operands.top().assignOp = t.token.assignOp;
else if (tt == HOOK)
++x.hookLevel;
else
++x.hookLevel; // tt == HOOK
}
t.scanOperand = true;
break;