[parser] Make pattern DCHECK dependent on !has_error
Bug: chromium:926036 Change-Id: Ibc8d3ffc3f9411fa33c0ed6326cb6b19a7d8dd05 Reviewed-on: https://chromium-review.googlesource.com/c/1442635 Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/master@{#59162}
This commit is contained in:
parent
c559f868a5
commit
b0e1c2bfe5
@ -1853,7 +1853,7 @@ void Parser::DesugarBindingInForEachStatement(ForInfo* for_info,
|
||||
for_info->parsing_result.declarations[0];
|
||||
Variable* temp = NewTemporary(ast_value_factory()->dot_for_string());
|
||||
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);
|
||||
InitializeVariables(&each_initialization_statements, NORMAL_VARIABLE, &decl);
|
||||
|
||||
|
5
test/mjsunit/regress/regress-926036.js
Normal file
5
test/mjsunit/regress/regress-926036.js
Normal file
@ -0,0 +1,5 @@
|
||||
// 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);
|
Loading…
Reference in New Issue
Block a user