mirror of
https://github.com/less/less.js.git
synced 2026-02-11 15:34:57 -05:00
support comments. Add failing test case for when mixin call does not have parent selectors
This commit is contained in:
@@ -575,9 +575,9 @@ less.Parser = function Parser(env) {
|
||||
if (input.charAt(i) !== '/') return;
|
||||
|
||||
if (input.charAt(i + 1) === '/') {
|
||||
return new(tree.Comment)($(/^\/\/.*/), true);
|
||||
return new(tree.Comment)($(/^\/\/.*/), true, i, env.currentFileInfo);
|
||||
} else if (comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
|
||||
return new(tree.Comment)(comment);
|
||||
return new(tree.Comment)(comment, false, i, env.currentFileInfo);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
(function (tree) {
|
||||
|
||||
tree.Comment = function (value, silent) {
|
||||
tree.Comment = function (value, silent, index, currentFileInfo) {
|
||||
this.value = value;
|
||||
this.silent = !!silent;
|
||||
this.currentFileInfo = currentFileInfo;
|
||||
};
|
||||
tree.Comment.prototype = {
|
||||
type: "Comment",
|
||||
toCSS: function (env) {
|
||||
return env.compress ? '' : this.value;
|
||||
return (env.compress || (this.currentFileInfo && this.currentFileInfo.silent)) ? '' : this.value;
|
||||
},
|
||||
eval: function () { return this }
|
||||
eval: function () { return this; }
|
||||
};
|
||||
|
||||
})(require('../tree'));
|
||||
|
||||
Reference in New Issue
Block a user