Fix the !in operator.

Refs #5789
This commit is contained in:
Gunnar Beutner 2014-03-18 15:48:50 +01:00
parent ec0557afea
commit f871758502
1 changed files with 13 additions and 1 deletions

View File

@ -94,7 +94,19 @@ Value AExpression::Evaluate(const Dictionary::Ptr& locals) const
return found;
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:
return (long)left && (long)right;
case AELogicalOr: