Commit 47794594 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by Commit Bot

[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/+/2335549Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69230}
parent 1a033ae8
......@@ -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();
......
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