Files
less.js/lib/less/tree/comment.js
Roman Ožana 77966d4457 Improve comments stripping in compress
Ignore comment during compress if starts with exclamation mark
2013-07-05 06:51:53 +01:00

22 lines
652 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 isReference = (this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced),
isCompressed = env.compress && !this.value.match(/^\/\*!/);
return (isReference || isCompressed) ? '' : this.value;
},
eval: function () { return this; },
markReferenced: function () {
this.isReferenced = true;
}
};
})(require('../tree'));