Files
less.js/lib/less/tree/comment.js
2013-07-05 06:52:32 +01:00

29 lines
842 B
JavaScript

(function (tree) {
tree.Comment = function (value, silent, index, currentFileInfo) {
this.value = value;
this.silent = !!silent;
this.currentFileInfo = currentFileInfo;
};
tree.Comment.prototype = {
type: "Comment",
toCSS: function (env) {
var debugInfo = "";
if (this.debugInfo) {
debugInfo = tree.debugInfo(env, this);
}
return debugInfo + this.value;
},
isSilent: function(env) {
var isReference = (this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced),
isCompressed = env.compress && !this.value.match(/^\/\*!/);
return this.silent || isReference || isCompressed;
},
eval: function () { return this; },
markReferenced: function () {
this.isReferenced = true;
}
};
})(require('../tree'));