Commit 66eaf9fe authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[parsing] Don't validate module if parsing failed.

Otherwise we might come across invalid locations.

Bug: chromium:923675
Change-Id: I0b01ba4b11cc7270744ec438bedb0b8ada2aa29d
Reviewed-on: https://chromium-review.googlesource.com/c/1426126
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59026}
parent 93adf913
...@@ -578,7 +578,8 @@ FunctionLiteral* Parser::DoParseProgram(Isolate* isolate, ParseInfo* info) { ...@@ -578,7 +578,8 @@ FunctionLiteral* Parser::DoParseProgram(Isolate* isolate, ParseInfo* info) {
factory()->NewExpressionStatement(initial_yield, kNoSourcePosition)); factory()->NewExpressionStatement(initial_yield, kNoSourcePosition));
ParseModuleItemList(&body); ParseModuleItemList(&body);
if (!module()->Validate(this->scope()->AsModuleScope(), if (!has_error() &&
!module()->Validate(this->scope()->AsModuleScope(),
pending_error_handler(), zone())) { pending_error_handler(), zone())) {
scanner()->set_parser_error(); scanner()->set_parser_error();
} }
......
// 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.
// MODULE
export class foo {[]};
*%(basename)s:7: SyntaxError: Unexpected token ]
export class foo {[]};
^
SyntaxError: Unexpected token ]
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