зеркало из https://github.com/mozilla/gecko-dev.git
Parallel fix to SpiderMonkey's bug 238945, to automatically insert ; after do-while on any error token.
This commit is contained in:
Родитель
73ca7a66e9
Коммит
8dcdcb1f89
|
@ -425,6 +425,13 @@ function Statement(t, x) {
|
||||||
n.isLoop = true;
|
n.isLoop = true;
|
||||||
n.body = nest(t, x, n, Statement, WHILE);
|
n.body = nest(t, x, n, Statement, WHILE);
|
||||||
n.condition = ParenExpression(t, x);
|
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;
|
break;
|
||||||
|
|
||||||
case BREAK:
|
case BREAK:
|
||||||
|
@ -723,8 +730,8 @@ loop:
|
||||||
operators.push(new Node(t));
|
operators.push(new Node(t));
|
||||||
if (tt == ASSIGN)
|
if (tt == ASSIGN)
|
||||||
operands.top().assignOp = t.token.assignOp;
|
operands.top().assignOp = t.token.assignOp;
|
||||||
else if (tt == HOOK)
|
else
|
||||||
++x.hookLevel;
|
++x.hookLevel; // tt == HOOK
|
||||||
}
|
}
|
||||||
t.scanOperand = true;
|
t.scanOperand = true;
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче