зеркало из https://github.com/microsoft/Power-Fx.git
Added new method on IExternalRule to help with invariantexpression ch… (#2725)
On an effort to remove null rule binding, we need the ability to have an option to apply null binding before doing the check if binding is null. This change adds a new method on IExternalRule to help with that.
This commit is contained in:
Родитель
a1560ea79f
Коммит
e1e538183a
|
@ -22,5 +22,8 @@ namespace Microsoft.PowerFx.Core.App.Controls
|
|||
|
||||
// Returns true when Binding is non-null, otherwise false.
|
||||
bool HasValidBinding { get; }
|
||||
|
||||
// Returns true when rule is constant.
|
||||
bool IsInvariantExpression { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3619,9 +3619,7 @@ namespace Microsoft.PowerFx.Core.Binding
|
|||
// we need to mark the node as constant, and save the control info so we may look up the
|
||||
// rule later.
|
||||
if (controlInfo?.GetRule(property.InvariantName) is IExternalRule rule &&
|
||||
rule.HasValidBinding &&
|
||||
!rule.HasErrorsOrWarnings &&
|
||||
rule.Binding.IsConstant(rule.Binding.Top))
|
||||
rule.IsInvariantExpression)
|
||||
{
|
||||
value = controlInfo;
|
||||
isConstant = true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче