Do not generate clean block in proxy function when the feature is disabled (#17112)

This commit is contained in:
Dongbo Wang
2022-04-05 12:00:41 -07:00
committed by GitHub
parent 5e37308e1b
commit 7cc9c87473
@@ -864,6 +864,15 @@ dynamicparam
", GetDynamicParamBlock());
}
string cleanBlock = string.Empty;
if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSCleanBlockFeatureName))
{
cleanBlock = string.Format(CultureInfo.InvariantCulture, @"
clean
{{{0}}}
", GetCleanBlock());
}
string result = string.Format(CultureInfo.InvariantCulture, @"{0}
param({1})
@@ -875,9 +884,7 @@ process
end
{{{5}}}
clean
{{{6}}}
{6}
<#
{7}
#>
@@ -888,7 +895,7 @@ clean
GetBeginBlock(),
GetProcessBlock(),
GetEndBlock(),
GetCleanBlock(),
cleanBlock,
CodeGeneration.EscapeBlockCommentContent(helpComment));
return result;