Commit 427a2fd5 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[parser] Fix preparsing of modules containing labels

Fixes spurious DCHECK triggering due to bug introduced in
https://chromium-review.googlesource.com/c/v8/v8/+/1836258.

Bug: chromium:1011596
Change-Id: Ia3b1eb25d326e465b3239f191aad11d90a2e56a8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1844777Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64125}
parent 65940f43
......@@ -1073,7 +1073,7 @@ class PreParser : public ParserBase<PreParser> {
V8_INLINE void DeclareLabel(ZonePtrList<const AstRawString>** labels,
ZonePtrList<const AstRawString>** own_labels,
const AstRawString* label) {
DCHECK(!parsing_module_);
DCHECK(!parsing_module_ || !label->IsOneByteEqualTo("await"));
}
// TODO(nikolaos): The preparser currently does not keep track of labels.
......@@ -1326,10 +1326,6 @@ class PreParser : public ParserBase<PreParser> {
return identifier.IsEvalOrArguments();
}
V8_INLINE bool IsAwait(const PreParserIdentifier& identifier) const {
return identifier.IsAwait();
}
// Returns true if the expression is of type "this.foo".
V8_INLINE static bool IsThisProperty(const PreParserExpression& expression) {
return expression.IsThisProperty();
......
// 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.
export function foo() {
{ label: 1 }
return 42;
}
// 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.
import "./regress-crbug-1011596-module.mjs"
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