Fix directive test
This commit is contained in:
parent
8a9e0a278b
commit
7190d0c28d
1 changed files with 10 additions and 6 deletions
|
@ -67,13 +67,17 @@ class _IsDirective extends Matcher {
|
||||||
item is DirectiveContext ? item : parseDirective(item.toString());
|
item is DirectiveContext ? item : parseDirective(item.toString());
|
||||||
if (directive == null) return false;
|
if (directive == null) return false;
|
||||||
if (valueOrVariable != null) {
|
if (valueOrVariable != null) {
|
||||||
if (directive.valueOrVariable == null)
|
if (directive.value == null)
|
||||||
return false;
|
return false;
|
||||||
else
|
else {
|
||||||
return valueOrVariable.matches(
|
var v = directive.value;
|
||||||
directive.valueOrVariable.value?.value ??
|
if (v is VariableContext) {
|
||||||
directive.valueOrVariable.variable?.name,
|
return valueOrVariable.matches(v.name, matchState);
|
||||||
matchState);
|
} else {
|
||||||
|
return valueOrVariable.matches(
|
||||||
|
directive.value.computeValue({}), matchState);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (argument != null) {
|
} else if (argument != null) {
|
||||||
if (directive.argument == null)
|
if (directive.argument == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue