зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1288459 - Split variable-statement parsing into its own parser function. r=arai
--HG-- extra : rebase_source : 574f08e92b8e8e9f0f35e86a48986e956828c09a
This commit is contained in:
Родитель
978e38289a
Коммит
151707db5d
|
@ -6424,6 +6424,18 @@ Parser<ParseHandler>::peekShouldParseLetDeclaration(bool* parseDeclOut,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename ParseHandler>
|
||||||
|
typename ParseHandler::Node
|
||||||
|
Parser<ParseHandler>::variableStatement(YieldHandling yieldHandling)
|
||||||
|
{
|
||||||
|
Node vars = declarationList(yieldHandling, PNK_VAR);
|
||||||
|
if (!vars)
|
||||||
|
return null();
|
||||||
|
if (!MatchOrInsertSemicolonAfterExpression(tokenStream))
|
||||||
|
return null();
|
||||||
|
return vars;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename ParseHandler>
|
template <typename ParseHandler>
|
||||||
typename ParseHandler::Node
|
typename ParseHandler::Node
|
||||||
Parser<ParseHandler>::statement(YieldHandling yieldHandling, bool canHaveDirectives)
|
Parser<ParseHandler>::statement(YieldHandling yieldHandling, bool canHaveDirectives)
|
||||||
|
@ -6442,14 +6454,8 @@ Parser<ParseHandler>::statement(YieldHandling yieldHandling, bool canHaveDirecti
|
||||||
return blockStatement(yieldHandling);
|
return blockStatement(yieldHandling);
|
||||||
|
|
||||||
// VariableStatement[?Yield]
|
// VariableStatement[?Yield]
|
||||||
case TOK_VAR: {
|
case TOK_VAR:
|
||||||
Node pn = declarationList(yieldHandling, PNK_VAR);
|
return variableStatement(yieldHandling);
|
||||||
if (!pn)
|
|
||||||
return null();
|
|
||||||
if (!MatchOrInsertSemicolonAfterExpression(tokenStream))
|
|
||||||
return null();
|
|
||||||
return pn;
|
|
||||||
}
|
|
||||||
|
|
||||||
// EmptyStatement
|
// EmptyStatement
|
||||||
case TOK_SEMI:
|
case TOK_SEMI:
|
||||||
|
|
|
@ -1046,6 +1046,8 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
|
||||||
Node catchBlockStatement(YieldHandling yieldHandling, HandlePropertyName simpleCatchParam);
|
Node catchBlockStatement(YieldHandling yieldHandling, HandlePropertyName simpleCatchParam);
|
||||||
Node debuggerStatement();
|
Node debuggerStatement();
|
||||||
|
|
||||||
|
Node variableStatement(YieldHandling yieldHandling);
|
||||||
|
|
||||||
Node lexicalDeclaration(YieldHandling yieldHandling, bool isConst);
|
Node lexicalDeclaration(YieldHandling yieldHandling, bool isConst);
|
||||||
Node importDeclaration();
|
Node importDeclaration();
|
||||||
Node exportDeclaration();
|
Node exportDeclaration();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче