Getters for logical expression properties
This commit is contained in:
@@ -396,6 +396,33 @@ ol.expression.Logical.prototype.evaluate = function(opt_scope, opt_fns,
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the logical operator.
|
||||||
|
* @return {string} The logical operator.
|
||||||
|
*/
|
||||||
|
ol.expression.Logical.prototype.getOperator = function() {
|
||||||
|
return this.operator_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the left expression.
|
||||||
|
* @return {ol.expression.Expression} The left expression.
|
||||||
|
*/
|
||||||
|
ol.expression.Logical.prototype.getLeft = function() {
|
||||||
|
return this.left_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the right expression.
|
||||||
|
* @return {ol.expression.Expression} The right expression.
|
||||||
|
*/
|
||||||
|
ol.expression.Logical.prototype.getRight = function() {
|
||||||
|
return this.right_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -372,6 +372,29 @@ describe('ol.expression.Logical', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var op = ol.expression.LogicalOp.AND;
|
||||||
|
var left = new ol.expression.Identifier('foo');
|
||||||
|
var right = new ol.expression.Literal(false);
|
||||||
|
var expr = new ol.expression.Logical(op, left, right);
|
||||||
|
|
||||||
|
describe('#getOperator()', function() {
|
||||||
|
it('gets the operator', function() {
|
||||||
|
expect(expr.getOperator()).to.be(op);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('#getLeft()', function() {
|
||||||
|
it('gets the left expression', function() {
|
||||||
|
expect(expr.getLeft()).to.be(left);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('#getRight()', function() {
|
||||||
|
it('gets the right expression', function() {
|
||||||
|
expect(expr.getRight()).to.be(right);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('ol.expression.Math', function() {
|
describe('ol.expression.Math', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user