Getter for identifier expression name

This commit is contained in:
Tim Schaub
2013-06-11 22:53:39 -06:00
parent 582a52849c
commit 6d6ec357e1
2 changed files with 14 additions and 0 deletions

View File

@@ -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`). * A literal expression (e.g. `"chicken"`, `42`, `true`, `null`).

View File

@@ -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() { describe('ol.expression.Literal', function() {