carto/lib/less/tree/call.js

19 lines
611 B
JavaScript
Raw Normal View History

if (typeof(require) !== 'undefined') { var tree = require('less/tree') }
2010-02-24 02:39:05 +08:00
tree.Call = function Call(name, args) {
2010-02-24 02:39:05 +08:00
this.name = name;
this.args = args;
};
2010-03-02 08:47:32 +08:00
tree.Call.prototype = {
2010-03-12 04:36:50 +08:00
eval: function (env) { return this },
2010-03-02 08:47:32 +08:00
toCSS: function (context, env) {
var args = this.args.map(function (a) { return a.eval() });
if (this.name in tree.functions) {
return tree.functions[this.name].apply(tree.functions, args).toCSS();
} else {
return this.name +
"(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")";
}
2010-03-02 08:47:32 +08:00
}
};