Commit e0c6671f authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Restore RETURN_IF_PARSE_ERROR in for/await

Bug: chromium:900085, v8:8363, v8:7926
Change-Id: I033bd4d95cdd85eee635279357c3c5d3fbe912c8
Reviewed-on: https://chromium-review.googlesource.com/c/1306438Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57116}
parent b839ed4f
......@@ -5896,6 +5896,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseForAwaitStatement(
BlockT body_block = impl()->NullStatement();
impl()->DesugarBindingInForEachStatement(&for_info, &body_block,
&each_variable);
RETURN_IF_PARSE_ERROR;
body_block->statements()->Add(body, zone());
body_block->set_scope(scope()->FinalizeBlockScope());
body = body_block;
......
// Copyright 2018 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 function f() { let v = 1; for await (var v of {}) { }",
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