mirror of https://github.com/Icinga/icinga2.git
parent
ec0557afea
commit
f871758502
|
@ -94,7 +94,19 @@ Value AExpression::Evaluate(const Dictionary::Ptr& locals) const
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
case AENotIn:
|
case AENotIn:
|
||||||
return left != right;
|
if (!right.IsObjectType<Array>())
|
||||||
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid right side argument for 'in' operator: " + JsonSerialize(right)));
|
||||||
|
|
||||||
|
arr = right;
|
||||||
|
found = false;
|
||||||
|
BOOST_FOREACH(const Value& value, arr) {
|
||||||
|
if (value == left) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return !found;
|
||||||
case AELogicalAnd:
|
case AELogicalAnd:
|
||||||
return (long)left && (long)right;
|
return (long)left && (long)right;
|
||||||
case AELogicalOr:
|
case AELogicalOr:
|
||||||
|
|
Loading…
Reference in New Issue