FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use old pattern · PowerShell/PowerShell@eca5759 · GitHub

Commit eca5759

Browse files
committed
Use old pattern
1 parent 2fc4f6f commit eca5759

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

‎src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ public class ExperimentalFeature
2222

2323
internal const string EngineSource = "PSEngine";
2424

25-
/// <summary>
26-
/// Experimental feature: Use culture invariant to-string convertor for lval in replace operator.
27-
/// </summary>
28-
public static readonly ExperimentalFeature PSCultureInvariantReplaceOperator =
29-
new ExperimentalFeature(
30-
name: nameof(PSCultureInvariantReplaceOperator),
31-
description: "Use culture invariant to-string convertor for lval in replace operator");
32-
3325
#endregion
3426

3527
#region Instance Members
@@ -125,7 +117,9 @@ static ExperimentalFeature()
125117
new ExperimentalFeature(
126118
name: "PSNullConditionalOperators",
127119
description: "Support the null conditional member access operators in PowerShell language"),
128-
PSCultureInvariantReplaceOperator,
120+
new ExperimentalFeature(
121+
name: "PSCultureInvariantReplaceOperator",
122+
description: "Use culture invariant to-string convertor for lval in replace operator"),
129123
};
130124
EngineExperimentalFeatures = new ReadOnlyCollection<ExperimentalFeature>(engineFeatures);
131125

‎src/System.Management.Automation/engine/lang/parserutils.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ internal static object ReplaceOperator(ExecutionContext context, IScriptExtent e
968968
if (list == null)
969969
{
970970
string lvalString;
971-
if (ExperimentalFeature.PSCultureInvariantReplaceOperator.Enabled)
971+
if (ExperimentalFeature.IsEnabled("PSCultureInvariantReplaceOperator"))
972972
{
973973
lvalString = PSObject.ToStringParser(context, lval) ?? string.Empty;
974974
}

‎test/powershell/Language/Operators/ReplaceOperator.Tests.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Describe "Replace Operator" -Tags CI {
6767

6868
Describe "Culture-invariance tests for -split and -replace" -Tags CI {
6969
BeforeAll {
70-
$skipTest = -not [ExperimentalFeature]::PSCultureInvariantReplaceOperator.Enabled
70+
$skipTest = -not [ExperimentalFeature]::IsEnabled("PSCultureInvariantReplaceOperator")
7171
if ($skipTest) {
7272
Write-Verbose "Test Suite Skipped. The test suite requires the experimental feature 'PSCultureInvariantReplaceOperator' to be enabled." -Verbose
7373
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL