[parser] Only validate async params of valid arrow functions

Bug: chromium:898936
Change-Id: I2c8d8212fa97436e32628d4030d36ce457346c1f
Reviewed-on: https://chromium-review.googlesource.com/c/1300133
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57014}
This commit is contained in:
Toon Verwaest 2018-10-25 22:44:10 +02:00 committed by Commit Bot
parent 1efaf46058
commit 69f370b6c0
2 changed files with 8 additions and 2 deletions

View File

@ -946,9 +946,10 @@ class ParserBase {
}
} else if (!classifier()->is_valid_arrow_formal_parameters()) {
ReportClassifierError(classifier()->arrow_formal_parameters_error());
} else {
DCHECK_IMPLIES(is_async,
classifier()->is_valid_async_arrow_formal_parameters());
}
DCHECK_IMPLIES(is_async,
classifier()->is_valid_async_arrow_formal_parameters());
}
void ValidateLetPattern() {

View File

@ -0,0 +1,5 @@
// 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(...x=e)()=>");