Integrate changes between [SD:717473] and [SD:725290]

This commit is contained in:
PowerShell Team authored and Sergei Vorobev committed 2016-07-28 18:02:24 -07:00
1 parent 2280bea11e
commit 0dd425da19
28 files changed
+848 -342

No files matched your search

@@ -1828,7 +1828,7 @@ namespace System.Management.Automation
if (_scriptBlock.HasBeginBlock)
{
RunClause(_runOptimized ? _scriptBlock.BeginBlock : _scriptBlock.UnoptimizedBeginBlock, AutomationNull.Value, _input.GetEnumerator());
RunClause(_runOptimized ? _scriptBlock.BeginBlock : _scriptBlock.UnoptimizedBeginBlock, AutomationNull.Value, _input);
}
}
@@ -1851,7 +1851,7 @@ namespace System.Management.Automation
}
if (_scriptBlock.HasProcessBlock)
{
RunClause(_runOptimized ? _scriptBlock.ProcessBlock : _scriptBlock.UnoptimizedProcessBlock, dollarUnder, _input.GetEnumerator());
RunClause(_runOptimized ? _scriptBlock.ProcessBlock : _scriptBlock.UnoptimizedProcessBlock, dollarUnder, _input);
_input.Clear();
}
}
@@ -1865,7 +1865,7 @@ namespace System.Management.Automation
if (_scriptBlock.HasEndBlock)
{
RunClause(_runOptimized ? _scriptBlock.EndBlock : _scriptBlock.UnoptimizedEndBlock, AutomationNull.Value, _input.ToArray().GetEnumerator());
RunClause(_runOptimized ? _scriptBlock.EndBlock : _scriptBlock.UnoptimizedEndBlock, AutomationNull.Value, _input.ToArray());
}
}
@@ -1125,7 +1125,8 @@ namespace System.Management.Automation
try
{
var converterInstance = Utils.GetAstToWorkflowConverterAndEnsureWorkflowModuleLoaded(context);
var workflows = converterInstance.CompileWorkflows(scriptBlockAst, context.EngineSessionState.Module, null, out parseErrors);
PSLanguageMode? languageMode = (context != null) ? context.LanguageMode : (PSLanguageMode?) null;
var workflows = converterInstance.CompileWorkflows(scriptBlockAst, context.EngineSessionState.Module, null, languageMode, out parseErrors);
foreach (var workflow in workflows)
{
context.EngineSessionState.SetWorkflowRaw(workflow,