Fix issue with last result not returning underlying variable value (#170)

This commit is contained in:
Peter Davis 2019-11-18 17:32:33 +10:30 committed by Sipke Schoorstra
parent b0a5962f4a
commit cdb2c655f6

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
@ -20,7 +20,7 @@ namespace Elsa.Scripting.JavaScript.Handlers
engine.SetValue("input", (Func<string, object>) (name => workflow.Input.GetVariable(name)));
engine.SetValue("variable", (Func<string, object>) (name => executionContext.CurrentScope.GetVariable(name)));
engine.SetValue("lastResult", (Func<string, object>) (name => executionContext.CurrentScope.LastResult));
engine.SetValue("lastResult", (Func<string, object>) (name => executionContext.CurrentScope.LastResult?.Value));
engine.SetValue("correlationId", (Func<object>) (() => executionContext.Workflow.CorrelationId));
engine.SetValue("currentCulture", (Func<object>) (() => CultureInfo.InvariantCulture));