Getter for literal expression value

This commit is contained in:
Tim Schaub
2013-06-11 22:54:07 -06:00
parent 6d6ec357e1
commit 3de330eb99
2 changed files with 15 additions and 0 deletions

View File

@@ -308,6 +308,15 @@ ol.expression.Literal.prototype.evaluate = function() {
}; };
/**
* Get the literal value.
* @return {string|number|boolean|null} The literal value.
*/
ol.expression.Literal.prototype.getValue = function() {
return this.value_;
};
/** /**
* @enum {string} * @enum {string}
*/ */

View File

@@ -312,6 +312,12 @@ describe('ol.expression.Literal', function() {
expect(expr.evaluate()).to.be(null); expect(expr.evaluate()).to.be(null);
}); });
}); });
describe('#getValue()', function() {
var expr = new ol.expression.Literal('asdf');
expect(expr.getValue()).to.be('asdf');
});
}); });