mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
start refactoring toCSS so we will be able to collect sourcemap information at the same time
This commit is contained in:
@@ -9,15 +9,21 @@ tree.Assignment.prototype = {
|
||||
accept: function (visitor) {
|
||||
this.value = visitor.visit(this.value);
|
||||
},
|
||||
toCSS: function () {
|
||||
return this.key + '=' + (this.value.toCSS ? this.value.toCSS() : this.value);
|
||||
},
|
||||
eval: function (env) {
|
||||
if (this.value.eval) {
|
||||
return new(tree.Assignment)(this.key, this.value.eval(env));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
},
|
||||
genCSS: function (env, output) {
|
||||
output.add(this.key + '=');
|
||||
if (this.value.genCSS) {
|
||||
this.value.genCSS(env, output);
|
||||
} else {
|
||||
output.add(this.value);
|
||||
}
|
||||
},
|
||||
toCSS: tree.toCSS
|
||||
};
|
||||
|
||||
})(require('../tree'));
|
||||
Reference in New Issue
Block a user