remove function test in evalCondition : a condition is now never a function

This commit is contained in:
Romain Beaumont 2015-05-08 04:05:46 +02:00
parent a1ec6138b7
commit ffa11996c4

View file

@ -119,23 +119,14 @@ for (var n in entityMetadataTypes) {
entityMetadataTypeBytes[entityMetadataTypes[n].type] = n;
}
function isFunction(functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
}
function evalCondition(condition,field_values)
{
if(!isFunction(condition))
{
var field_value_to_test="this" in condition && condition["this"] ? field_values["this"][condition.field] : field_values[condition.field];
var b=condition.values.some(function(value) {return field_value_to_test===value;});
if("different" in condition && condition["different"])
return !b;
else
return b;
}
return condition(field_values);
var field_value_to_test="this" in condition && condition["this"] ? field_values["this"][condition.field] : field_values[condition.field];
var b=condition.values.some(function(value) {return field_value_to_test===value;});
if("different" in condition && condition["different"])
return !b;
else
return b;
}
function sizeOfEntityMetadata(value) {