///<summary> /// Continue running script from the point after the intermediate state was produced. ///</summary> private bool TryRunFrom(ScriptState state, out ScriptExecutionState executionState, out object value) { if (state.Script == this) { value = state.ReturnValue; executionState = state.ExecutionState.FreezeAndClone(); return(true); } else if (_previous != null && _previous.TryRunFrom(state, out executionState, out value)) { var executor = this.GetExecutor(CancellationToken.None); value = executionState.RunSubmission(executor); return(true); } else { // couldn't find starting point to continue running from. value = null; executionState = null; return(false); } }