Bug 892561 - Inline Parser::bracketedExpr() into its only call site, in Parser::parenExpr(). r=Waldo.

--HG--
extra : rebase_source : a1e9ce81638fd543c1e21cb69d81c9767118b7c9
This commit is contained in:
Jason Orendorff 2013-07-15 11:22:06 -05:00
Родитель 3364493dd4
Коммит b39ca9caf1
2 изменённых файлов: 10 добавлений и 18 удалений

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

@ -6222,22 +6222,6 @@ Parser<ParseHandler>::memberExpr(TokenKind tt, bool allowCallSyntax)
return lhs;
}
template <typename ParseHandler>
typename ParseHandler::Node
Parser<ParseHandler>::bracketedExpr()
{
/*
* Always accept the 'in' operator in a parenthesized expression,
* where it's unambiguous, even if we might be parsing the init of a
* for statement.
*/
bool oldParsingForInit = pc->parsingForInit;
pc->parsingForInit = false;
Node pn = expr();
pc->parsingForInit = oldParsingForInit;
return pn;
}
template <typename ParseHandler>
typename ParseHandler::Node
Parser<ParseHandler>::newName(PropertyName *name)
@ -6752,7 +6736,16 @@ Parser<ParseHandler>::parenExpr(bool *genexp)
GenexpGuard<ParseHandler> guard(this);
Node pn = bracketedExpr();
/*
* Always accept the 'in' operator in a parenthesized expression,
* where it's unambiguous, even if we might be parsing the init of a
* for statement.
*/
bool oldParsingForInit = pc->parsingForInit;
pc->parsingForInit = false;
Node pn = expr();
pc->parsingForInit = oldParsingForInit;
if (!pn)
return null();
guard.endBody();

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

@ -500,7 +500,6 @@ class Parser : private AutoGCRooter, public StrictModeGetter
bool arrayInitializerComprehensionTail(Node pn);
Node generatorExpr(Node kid);
bool argumentList(Node listNode);
Node bracketedExpr();
Node letBlock(LetContext letContext);
Node destructuringExpr(BindData<ParseHandler> *data, TokenKind tt);