From 477945949325d1032c84c3eaa55e099825cc7d28 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Mon, 3 Aug 2020 11:34:11 -0700 Subject: [PATCH] [optional-chaining] Check optionality last when checking for direct eval Bug: chromium:1112221 Change-Id: I402df2071eed82f44669910cf8e234f727e09581 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2335549 Reviewed-by: Leszek Swirski Commit-Queue: Shu-yu Guo Cr-Commit-Position: refs/heads/master@{#69230} --- src/parsing/parser-base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h index 3dfdc4e048..22de3d0691 100644 --- a/src/parsing/parser-base.h +++ b/src/parsing/parser-base.h @@ -1405,8 +1405,8 @@ class ParserBase { Call::PossiblyEval CheckPossibleEvalCall(ExpressionT expression, bool is_optional_call, Scope* scope) { - if (!is_optional_call && impl()->IsIdentifier(expression) && - impl()->IsEval(impl()->AsIdentifier(expression))) { + if (impl()->IsIdentifier(expression) && + impl()->IsEval(impl()->AsIdentifier(expression)) && !is_optional_call) { function_state_->RecordFunctionOrEvalCall(); scope->RecordEvalCall();