Expression literal
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
goog.provide('ol.Expression');
|
||||
goog.provide('ol.ExpressionLiteral');
|
||||
|
||||
|
||||
|
||||
@@ -41,3 +42,29 @@ ol.Expression.prototype.evaluate = function(opt_thisArg, opt_scope) {
|
||||
var evaluator = new Function(names.join(','), 'return ' + this.source_);
|
||||
return evaluator.apply(thisArg, values);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Expression}
|
||||
* @param {*} value Literal value.
|
||||
*/
|
||||
ol.ExpressionLiteral = function(value) {
|
||||
|
||||
/**
|
||||
* @type {*}
|
||||
* @private
|
||||
*/
|
||||
this.value_ = value;
|
||||
|
||||
};
|
||||
goog.inherits(ol.ExpressionLiteral, ol.Expression);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.ExpressionLiteral.prototype.evaluate = function(opt_thisArg, opt_scope) {
|
||||
return this.value_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user