зеркало из https://github.com/mozilla/gecko-dev.git
Bug 883333, part 11 - Refactor debugger statement parsing. r=Waldo.
--HG-- extra : rebase_source : f39ad2d7cadc43d2706556933fdc5311bd262bb2
This commit is contained in:
Родитель
75aaa9d753
Коммит
0a53f84be3
|
@ -4773,6 +4773,22 @@ Parser<ParseHandler>::tryStatement()
|
|||
return pn;
|
||||
}
|
||||
|
||||
template <typename ParseHandler>
|
||||
typename ParseHandler::Node
|
||||
Parser<ParseHandler>::debuggerStatement()
|
||||
{
|
||||
TokenPos p;
|
||||
p.begin = pos().begin;
|
||||
if (!MatchOrInsertSemicolon(context, &tokenStream))
|
||||
return null();
|
||||
p.end = pos().end;
|
||||
|
||||
pc->sc->setBindingsAccessedDynamically();
|
||||
pc->sc->setHasDebuggerStatement();
|
||||
|
||||
return handler.newDebuggerStatement(p);
|
||||
}
|
||||
|
||||
template <typename ParseHandler>
|
||||
typename ParseHandler::Node
|
||||
Parser<ParseHandler>::statement(bool canHaveDirectives)
|
||||
|
@ -4863,12 +4879,7 @@ Parser<ParseHandler>::statement(bool canHaveDirectives)
|
|||
return functionStmt();
|
||||
|
||||
case TOK_DEBUGGER:
|
||||
pn = handler.newDebuggerStatement(pos());
|
||||
if (!pn)
|
||||
return null();
|
||||
pc->sc->setBindingsAccessedDynamically();
|
||||
pc->sc->setHasDebuggerStatement();
|
||||
break;
|
||||
return debuggerStatement();
|
||||
|
||||
/* TOK_CATCH and TOK_FINALLY are both handled in the TOK_TRY case */
|
||||
case TOK_CATCH:
|
||||
|
|
|
@ -429,6 +429,8 @@ struct Parser : private AutoGCRooter, public StrictModeGetter
|
|||
Node labeledStatement();
|
||||
Node throwStatement();
|
||||
Node tryStatement();
|
||||
Node debuggerStatement();
|
||||
|
||||
#if JS_HAS_BLOCK_SCOPE
|
||||
Node letStatement();
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче