Getter for identifier expression name
This commit is contained in:
@@ -271,6 +271,15 @@ ol.expression.Identifier.prototype.evaluate = function(opt_scope) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Get the identifier name.
|
||||
* @return {string} The identifier name.
|
||||
*/
|
||||
ol.expression.Identifier.prototype.getName = function() {
|
||||
return this.name_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A literal expression (e.g. `"chicken"`, `42`, `true`, `null`).
|
||||
|
||||
@@ -274,6 +274,11 @@ describe('ol.expression.Identifier', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getName()', function() {
|
||||
var expr = new ol.expression.Identifier('asdf');
|
||||
expect(expr.getName()).to.be('asdf');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('ol.expression.Literal', function() {
|
||||
|
||||
Reference in New Issue
Block a user