[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/+/1844777 Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Dan Elphick <delphick@chromium.org> Cr-Commit-Position: refs/heads/master@{#64125}
This commit is contained in:
parent
65940f4369
commit
427a2fd5a9
@ -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();
|
||||
|
8
test/mjsunit/regress/regress-crbug-1011596-module.mjs
Normal file
8
test/mjsunit/regress/regress-crbug-1011596-module.mjs
Normal file
@ -0,0 +1,8 @@
|
||||
// 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;
|
||||
}
|
5
test/mjsunit/regress/regress-crbug-1011596.mjs
Normal file
5
test/mjsunit/regress/regress-crbug-1011596.mjs
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.
|
||||
|
||||
import "./regress-crbug-1011596-module.mjs"
|
Loading…
Reference in New Issue
Block a user