mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-15 22:29:08 +00:00
Add clean block to script block as a peer to begin, process, and end to allow easy resource cleanup (#15177)
This commit is contained in:
1 parent
fa4bfb447e
commit
a32700a1c1
30 files changed
+3055
-644
No files matched your search
@@ -945,25 +945,11 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
_currentBlock = _entryBlock;
|
||||
|
||||
if (scriptBlockAst.DynamicParamBlock != null)
|
||||
{
|
||||
scriptBlockAst.DynamicParamBlock.Accept(this);
|
||||
}
|
||||
|
||||
if (scriptBlockAst.BeginBlock != null)
|
||||
{
|
||||
scriptBlockAst.BeginBlock.Accept(this);
|
||||
}
|
||||
|
||||
if (scriptBlockAst.ProcessBlock != null)
|
||||
{
|
||||
scriptBlockAst.ProcessBlock.Accept(this);
|
||||
}
|
||||
|
||||
if (scriptBlockAst.EndBlock != null)
|
||||
{
|
||||
scriptBlockAst.EndBlock.Accept(this);
|
||||
}
|
||||
scriptBlockAst.DynamicParamBlock?.Accept(this);
|
||||
scriptBlockAst.BeginBlock?.Accept(this);
|
||||
scriptBlockAst.ProcessBlock?.Accept(this);
|
||||
scriptBlockAst.EndBlock?.Accept(this);
|
||||
scriptBlockAst.CleanBlock?.Accept(this);
|
||||
|
||||
_currentBlock.FlowsTo(_exitBlock);
|
||||
|
||||
|
||||
Reference in new issue
Block a user