diff --git a/src/ScriptEngine/Machine/MachineInstance.cs b/src/ScriptEngine/Machine/MachineInstance.cs index 4eee2a4f3..f85858bfe 100644 --- a/src/ScriptEngine/Machine/MachineInstance.cs +++ b/src/ScriptEngine/Machine/MachineInstance.cs @@ -274,6 +274,7 @@ public IValue EvaluateInFrame(string expression, int frameId) Module = code, ThisScope = localScope, Locals = Array.Empty(), + Scopes = CreateFrameScopes(selectedFrame.Scopes, localScope), InstructionPointer = 0, }; } @@ -2496,10 +2497,8 @@ private ExecutionFrameInfo FrameInfo(StackRuntimeModule module, ExecutionFrame f [ThreadStatic] private static MachineInstance _currentThreadWorker; - private static void SetCurrentMachineInstance(MachineInstance inst) - { - _currentThreadWorker = inst; - } + private static void SetCurrentMachineInstance(MachineInstance current) + => _currentThreadWorker = current; public static MachineInstance Current {