Permalink
Browse files

Expression literal

  • Loading branch information...
1 parent 360e371 commit 1faa6214f11969a971914981a32822fce358a0b2 @tschaub tschaub committed Feb 20, 2013
Showing with 27 additions and 0 deletions.
  1. +27 −0 src/ol/expression.js
View
@@ -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_;
+};

0 comments on commit 1faa621

Please sign in to comment.