Files
less.js/lib/less/tree/comment.js
Matthew Dean 42fd7dca20 Release v3.5.0 beta (#3230)
* Lint cleanup of quotes
* v3.5.0-beta
2018-06-24 20:14:33 -07:00

24 lines
765 B
JavaScript

var Node = require('./node'),
getDebugInfo = require('./debug-info');
var Comment = function (value, isLineComment, index, currentFileInfo) {
this.value = value;
this.isLineComment = isLineComment;
this._index = index;
this._fileInfo = currentFileInfo;
this.allowRoot = true;
};
Comment.prototype = new Node();
Comment.prototype.type = 'Comment';
Comment.prototype.genCSS = function (context, output) {
if (this.debugInfo) {
output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());
}
output.add(this.value);
};
Comment.prototype.isSilent = function(context) {
var isCompressed = context.compress && this.value[2] !== '!';
return this.isLineComment || isCompressed;
};
module.exports = Comment;