Fix directive test

This commit is contained in:
Tobe O 2019-08-07 21:55:20 -04:00
parent 8a9e0a278b
commit 7190d0c28d

View file

@ -67,13 +67,17 @@ class _IsDirective extends Matcher {
item is DirectiveContext ? item : parseDirective(item.toString());
if (directive == null) return false;
if (valueOrVariable != null) {
if (directive.valueOrVariable == null)
if (directive.value == null)
return false;
else
else {
var v = directive.value;
if (v is VariableContext) {
return valueOrVariable.matches(v.name, matchState);
} else {
return valueOrVariable.matches(
directive.valueOrVariable.value?.value ??
directive.valueOrVariable.variable?.name,
matchState);
directive.value.computeValue({}), matchState);
}
}
} else if (argument != null) {
if (directive.argument == null)
return false;