Commit b0e1c2bf authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[parser] Make pattern DCHECK dependent on !has_error

Bug: chromium:926036
Change-Id: Ibc8d3ffc3f9411fa33c0ed6326cb6b19a7d8dd05
Reviewed-on: https://chromium-review.googlesource.com/c/1442635Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59162}
parent c559f868
...@@ -1853,7 +1853,7 @@ void Parser::DesugarBindingInForEachStatement(ForInfo* for_info, ...@@ -1853,7 +1853,7 @@ void Parser::DesugarBindingInForEachStatement(ForInfo* for_info,
for_info->parsing_result.declarations[0]; for_info->parsing_result.declarations[0];
Variable* temp = NewTemporary(ast_value_factory()->dot_for_string()); Variable* temp = NewTemporary(ast_value_factory()->dot_for_string());
ScopedPtrList<Statement> each_initialization_statements(pointer_buffer()); ScopedPtrList<Statement> each_initialization_statements(pointer_buffer());
DCHECK_NOT_NULL(decl.pattern); DCHECK_IMPLIES(!has_error(), decl.pattern != nullptr);
decl.initializer = factory()->NewVariableProxy(temp, for_info->position); decl.initializer = factory()->NewVariableProxy(temp, for_info->position);
InitializeVariables(&each_initialization_statements, NORMAL_VARIABLE, &decl); InitializeVariables(&each_initialization_statements, NORMAL_VARIABLE, &decl);
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
assertThrows("async() => { for await (var a ;;) {} }", SyntaxError);
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