Always provide lib functions, conditionally provide scope

This commit is contained in:
Tim Schaub
2013-10-07 09:46:24 -06:00
parent 37a7ac1f5b
commit 60a13d6517

View File

@@ -21,14 +21,11 @@ goog.require('ol.geom.GeometryType');
* @return {*} The result of the expression.
*/
ol.expr.evaluateFeature = function(expr, opt_feature) {
var result;
var scope;
if (goog.isDef(opt_feature)) {
result = expr.evaluate(
opt_feature.getAttributes(), ol.expr.lib, opt_feature);
} else {
result = expr.evaluate();
scope = opt_feature.getAttributes();
}
return result;
return expr.evaluate(scope, ol.expr.lib, opt_feature);
};