[parser] Relax DCHECK in has_error() case

No-Tree-Checks: true
No-Try: true
Bug: chromium:908231
Change-Id: I1acf33400ad3546974a0ccb5955f8c6966b17dcf
Reviewed-on: https://chromium-review.googlesource.com/c/1350116
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57815}
This commit is contained in:
Toon Verwaest 2018-11-26 09:55:02 +01:00 committed by Commit Bot
parent 0453d41885
commit 536f62c49a
2 changed files with 9 additions and 1 deletions

View File

@ -2497,7 +2497,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// immediately). bar can be parsed lazily, but we need to parse it in a mode
// that tracks unresolved variables.
DCHECK_IMPLIES(parse_lazily(), FLAG_lazy);
DCHECK_IMPLIES(parse_lazily(), allow_lazy_);
DCHECK_IMPLIES(parse_lazily(), has_error() || allow_lazy_);
DCHECK_IMPLIES(parse_lazily(), extension_ == nullptr);
const bool is_lazy =

View File

@ -0,0 +1,8 @@
// 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(`
class C {
get [(function() { function lazy() { Syntax Error } })()]() {}
}`, SyntaxError)