carto/lib/less/tree/expression.js

22 lines
532 B
JavaScript
Raw Normal View History

(function (tree) {
2010-06-19 13:51:26 +08:00
tree.Expression = function (value) { this.value = value };
2010-03-08 12:38:10 +08:00
tree.Expression.prototype = {
eval: function (env) {
if (this.value.length > 1) {
return new(tree.Expression)(this.value.map(function (e) {
return e.eval(env);
}));
} else {
return this.value[0].eval(env);
2010-02-24 02:39:05 +08:00
}
2010-03-08 12:38:10 +08:00
},
toCSS: function () {
return this.value.map(function (e) {
return e.toCSS();
}).join(' ');
2010-03-08 12:38:10 +08:00
}
2010-02-24 02:39:05 +08:00
};
})(require('less/tree'));