[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:
parent
1efaf46058
commit
69f370b6c0
@ -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() {
|
||||
|
5
test/mjsunit/regress/regress-898936.js
Normal file
5
test/mjsunit/regress/regress-898936.js
Normal 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)()=>");
|
Loading…
Reference in New Issue
Block a user