Commit 3f967aed authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Get rid of the last remaining 'bool ok'

Bug: v8:7926
Change-Id: I012b5bbf25b7aa4cbef64cce302c8ae971589663
Reviewed-on: https://chromium-review.googlesource.com/c/1309758Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57170}
parent 0f15ed05
......@@ -5665,7 +5665,6 @@ ParserBase<Impl>::ParseStandardForLoopWithLexicalDeclarations(
int stmt_pos, StatementT init, ForInfo* for_info,
ZonePtrList<const AstRawString>* labels,
ZonePtrList<const AstRawString>* own_labels) {
bool ok = true;
// The condition and the next statement of the for loop must be parsed
// in a new scope.
Scope* inner_scope = NewScope(BLOCK_SCOPE);
......@@ -5687,7 +5686,7 @@ ParserBase<Impl>::ParseStandardForLoopWithLexicalDeclarations(
function_state_->contains_function_or_eval()) {
scope()->set_is_hidden();
return impl()->DesugarLexicalBindingsInForStatement(
loop, init, cond, next, body, inner_scope, *for_info, &ok);
loop, init, cond, next, body, inner_scope, *for_info);
} else {
inner_scope = inner_scope->FinalizeBlockScope();
DCHECK_NULL(inner_scope);
......
This diff is collapsed.
......@@ -244,7 +244,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
// function wrapper.
void ParseWrapped(Isolate* isolate, ParseInfo* info,
ZonePtrList<Statement>* body, DeclarationScope* scope,
Zone* zone, bool* ok);
Zone* zone);
ZonePtrList<const AstRawString>* PrepareWrappedArguments(Isolate* isolate,
ParseInfo* info,
......@@ -390,7 +390,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Statement* DesugarLexicalBindingsInForStatement(
ForStatement* loop, Statement* init, Expression* cond, Statement* next,
Statement* body, Scope* inner_scope, const ForInfo& for_info, bool* ok);
Statement* body, Scope* inner_scope, const ForInfo& for_info);
Expression* RewriteDoExpression(Block* body, int pos);
......
......@@ -81,16 +81,12 @@ PreParser::PreParseResult PreParser::PreParseProgram() {
FunctionState top_scope(&function_state_, &scope_, scope);
original_scope_ = scope_;
bool ok = true;
int start_position = scanner()->peek_location().beg_pos;
PreParserStatementList body;
ParseStatementList(body, Token::EOS);
ok = !has_error();
original_scope_ = nullptr;
if (stack_overflow()) return kPreParseStackOverflow;
if (!ok) {
ReportUnexpectedToken(scanner()->current_token());
} else if (is_strict(language_mode())) {
if (is_strict(language_mode())) {
CheckStrictOctalLiteral(start_position, scanner()->location().end_pos);
}
return kPreParseSuccess;
......
......@@ -1424,8 +1424,7 @@ class PreParser : public ParserBase<PreParser> {
V8_INLINE StatementT DesugarLexicalBindingsInForStatement(
PreParserStatement loop, PreParserStatement init,
const PreParserExpression& cond, PreParserStatement next,
PreParserStatement body, Scope* inner_scope, const ForInfo& for_info,
bool* ok) {
PreParserStatement body, Scope* inner_scope, const ForInfo& for_info) {
// See Parser::DesugarLexicalBindingsInForStatement.
for (auto name : for_info.bound_names) {
inner_scope->DeclareVariableName(name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment