Commit 9675811a authored by jwolfe's avatar jwolfe Committed by Commit bot

Heuristic for eager parsing works for async functions

The heuristic checks for "(function", and now it also checks for
"(async function".

BUG=v8:4230

Review-Url: https://codereview.chromium.org/2682173005
Cr-Commit-Position: refs/heads/master@{#43120}
parent 21523c78
......@@ -1845,7 +1845,8 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParsePrimaryExpression(
}
// Heuristically try to detect immediately called functions before
// seeing the call parentheses.
if (peek() == Token::FUNCTION) {
if (peek() == Token::FUNCTION ||
(peek() == Token::ASYNC && PeekAhead() == Token::FUNCTION)) {
function_state_->set_next_function_is_likely_called();
}
ExpressionT expr = ParseExpressionCoverGrammar(true, CHECK_OK);
......
......@@ -407,7 +407,6 @@
# PreParser doesn't produce early errors
# https://bugs.chromium.org/p/v8/issues/detail?id=2728
'language/expressions/async-arrow-function/early-errors-arrow-formals-body-duplicate': [FAIL],
'language/expressions/async-function/early-errors-expression-formals-body-duplicate': [FAIL],
'language/expressions/object/method-definition/generator-param-redecl-const': [FAIL],
'language/expressions/object/method-definition/generator-param-redecl-let': [FAIL],
'language/expressions/object/method-definition/name-param-redecl': [FAIL],
......
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