fix spacing issue with extends and fix tests

This commit is contained in:
Luke Page
2013-10-20 11:28:47 +01:00
parent 145406b539
commit 9a7351d27f
3 changed files with 11 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ less.Parser = function Parser(env) {
chunks, // chunkified input
current, // index of current chunk, in `input`
parser,
rootFilename = env.filename;
rootFilename = env && env.filename;
// Top parser on an import tree must be sure there is one "env"
// which will then be passed around by reference.
@@ -1278,7 +1278,7 @@ less.Parser = function Parser(env) {
$(this.comments);
if (! $(',')) { break; }
if (s.condition) {
error("Guards are only currently allowed on a single selector. ");
error("Guards are only currently allowed on a single selector.");
}
$(this.comments);
}

View File

@@ -30,9 +30,16 @@ tree.Extend.prototype = {
},
findSelfSelectors: function (selectors) {
var selfElements = [],
i;
i,
selectorElements;
for(i = 0; i < selectors.length; i++) {
selectorElements = selectors[i].elements;
// duplicate the logic in genCSS function inside the selector node.
// future TODO - move both logics into the selector joiner visitor
if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === "") {
selectorElements[0].combinator.value = ' ';
}
selfElements = selfElements.concat(selectors[i].elements);
}

View File

@@ -1,4 +1,4 @@
SyntaxError: Guards are only currently allowed on a single selector. in {path}multiple-guards-on-css-selectors.less on line 3, column 1:
SyntaxError: Guards are only currently allowed on a single selector. in {path}multiple-guards-on-css-selectors.less on line 3, column 1:
2 .a when (@ie8 = true),
3 .b {
4 }