mirror of
https://github.com/less/less.js.git
synced 2026-02-08 22:15:04 -05:00
Conflicts: lib/less/functions.js lib/less/index.js lib/less/tree/anonymous.js lib/less/tree/media.js lib/less/tree/mixin.js
35 lines
847 B
JavaScript
35 lines
847 B
JavaScript
module.exports = function (tree) {
|
|
|
|
var Anonymous = function (string, index, currentFileInfo, mapLines) {
|
|
this.value = string.value || string;
|
|
this.index = index;
|
|
this.mapLines = mapLines;
|
|
this.currentFileInfo = currentFileInfo;
|
|
};
|
|
Anonymous.prototype = {
|
|
type: "Anonymous",
|
|
eval: function () {
|
|
return new Anonymous(this.value, this.index, this.currentFileInfo, this.mapLines);
|
|
},
|
|
compare: function (x) {
|
|
if (!x.toCSS) {
|
|
return -1;
|
|
}
|
|
|
|
var left = this.toCSS(),
|
|
right = x.toCSS();
|
|
|
|
if (left === right) {
|
|
return 0;
|
|
}
|
|
|
|
return left < right ? -1 : 1;
|
|
},
|
|
genCSS: function (env, output) {
|
|
output.add(this.value, this.currentFileInfo, this.index, this.mapLines);
|
|
},
|
|
toCSS: tree.toCSS
|
|
};
|
|
return Anonymous;
|
|
};
|