[parser] Reset the calls_eval flag after arrow head

Otherwise it's propagated to the parent

Bug: chromium:1394973
Change-Id: I178f9d5d863aec501525a783846d1df6d3031bb2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4100687
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84808}
This commit is contained in:
Toon Verwaest 2022-12-13 13:35:17 +01:00 committed by V8 LUCI CQ
parent b095103b7e
commit e1e08901c2
2 changed files with 8 additions and 0 deletions

View File

@ -929,6 +929,7 @@ void Scope::Snapshot::Reparent(DeclarationScope* new_parent) {
// Move eval calls since Snapshot's creation into new_parent.
if (outer_scope_->calls_eval_) {
new_parent->RecordEvalCall();
outer_scope_->calls_eval_ = false;
declaration_scope_->sloppy_eval_can_extend_vars_ = false;
}
}

View File

@ -0,0 +1,7 @@
// Copyright 2022 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.
// Flags: --stress-lazy-source-positions
((__v_0 = ((__v_0 =eval()) => {})()) => {})()