diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc index cecce4c501..404822d1ab 100644 --- a/src/ast/scopes.cc +++ b/src/ast/scopes.cc @@ -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; } } diff --git a/test/mjsunit/regress/regress-crbug-1394973.js b/test/mjsunit/regress/regress-crbug-1394973.js new file mode 100644 index 0000000000..c0b9ceebcc --- /dev/null +++ b/test/mjsunit/regress/regress-crbug-1394973.js @@ -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()) => {})()) => {})()