Skip to content

Commit

Permalink
RemoveAll delegation fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-joyle committed Dec 19, 2024
1 parent 8983927 commit ee8e4b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ internal interface IExternalEnabledFeatures

bool IsEnhancedComponentFunctionPropertyEnabled { get; }

bool IsComponentFunctionPropertyDataflowEnabled { get; }

bool IsRemoveAllDelegationEnabled { get; }
bool IsComponentFunctionPropertyDataflowEnabled { get; }
}

internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures
Expand All @@ -39,7 +37,5 @@ internal sealed class DefaultEnabledFeatures : IExternalEnabledFeatures
public bool IsEnhancedComponentFunctionPropertyEnabled => true;

public bool IsComponentFunctionPropertyDataflowEnabled => true;

public bool IsRemoveAllDelegationEnabled => true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public sealed class Features
/// </summary>
internal bool IsUserDefinedTypesEnabled { get; init; } = false;

/// <summary>
/// Enables RemoveAll delegation.
/// </summary>
internal bool IsRemoveAllDelegationEnabled { get; init; }

internal static readonly Features None = new Features();

/// <summary>
Expand Down Expand Up @@ -124,6 +129,7 @@ internal Features(Features other)
AsTypeLegacyCheck = other.AsTypeLegacyCheck;
JsonFunctionAcceptsLazyTypes = other.JsonFunctionAcceptsLazyTypes;
IsLookUpReductionDelegationEnabled = other.IsLookUpReductionDelegationEnabled;
IsRemoveAllDelegationEnabled = other.IsRemoveAllDelegationEnabled;
}
}
}
2 changes: 1 addition & 1 deletion src/libraries/Microsoft.PowerFx.Core/Texl/Remove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ public override bool IsServerDelegatable(CallNode callNode, TexlBinding binding)
}

// Use ECS flag as a guard.
if (binding.Document != null && !binding.Document.Properties.EnabledFeatures.IsRemoveAllDelegationEnabled)
if (!binding.Features.IsRemoveAllDelegationEnabled)
{
return false;
}
Expand Down

0 comments on commit ee8e4b8

Please sign in to comment.