From 3d6d6d61c695357eeba4e08a7ec529c5b0db8c45 Mon Sep 17 00:00:00 2001 From: akpaevj Date: Sat, 28 Sep 2024 18:46:59 +0300 Subject: [PATCH] closes #1451 --- src/ScriptEngine/Machine/RuntimeScopes.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ScriptEngine/Machine/RuntimeScopes.cs b/src/ScriptEngine/Machine/RuntimeScopes.cs index b1e175d0f..88888251b 100644 --- a/src/ScriptEngine/Machine/RuntimeScopes.cs +++ b/src/ScriptEngine/Machine/RuntimeScopes.cs @@ -8,6 +8,7 @@ This Source Code Form is subject to the terms of the using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using OneScript.Contexts; namespace ScriptEngine.Machine @@ -24,7 +25,7 @@ public class RuntimeScopes : IReadOnlyList public RuntimeScopes(IReadOnlyList outerScopes, AttachedContext innerScope) { - _outerScopes = outerScopes; + _outerScopes = outerScopes.Select(x => new AttachedContext(x.Instance)).ToList(); _innerScope = innerScope; _outerScopeLast = _outerScopes.Count - 1;