Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index d74b36604f8b6acf7a2d9adf25178f4c5156712f..8bf1cbd7f05eb7e8a1f3a006658df99f06e1815e 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -1098,8 +1098,14 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info, |
bool is_async = allow_harmony_async_await() && shared_info->is_async(); |
if (is_async) { |
DCHECK(!scanner()->HasAnyLineTerminatorAfterNext()); |
- Consume(Token::ASYNC); |
- DCHECK(peek_any_identifier() || peek() == Token::LPAREN); |
+ if (!Check(Token::ASYNC)) { |
+ CHECK(stack_overflow()); |
+ return nullptr; |
+ } |
+ if (!(peek_any_identifier() || peek() == Token::LPAREN)) { |
+ CHECK(stack_overflow()); |
+ return nullptr; |
+ } |
} |
// TODO(adamk): We should construct this scope from the ScopeInfo. |