mirror of
https://github.com/less/less.js.git
synced 2026-01-23 06:07:56 -05:00
Merge pull request #2385 from ddprrt/extend-warnings
checking for doubles when warning for empty extends
This commit is contained in:
@@ -95,6 +95,7 @@ var ProcessExtendsVisitor = function() {
|
||||
ProcessExtendsVisitor.prototype = {
|
||||
run: function(root) {
|
||||
var extendFinder = new ExtendFinderVisitor();
|
||||
this.extendIndicies = {};
|
||||
extendFinder.run(root);
|
||||
if (!extendFinder.foundExtends) { return root; }
|
||||
root.allExtends = root.allExtends.concat(this.doExtendChaining(root.allExtends, root.allExtends));
|
||||
@@ -104,6 +105,7 @@ ProcessExtendsVisitor.prototype = {
|
||||
return newRoot;
|
||||
},
|
||||
checkExtendsForNonMatched: function(extendList) {
|
||||
var indicies = this.extendIndicies;
|
||||
extendList.filter(function(extend) {
|
||||
return !extend.hasFoundMatches && extend.parent_ids.length == 1;
|
||||
}).forEach(function(extend) {
|
||||
@@ -111,7 +113,11 @@ ProcessExtendsVisitor.prototype = {
|
||||
try {
|
||||
selector = extend.selector.toCSS({});
|
||||
}catch(_){}
|
||||
logger.warn("extend '"+selector+"' has no matches");
|
||||
|
||||
if(!indicies[extend.index + ' ' + selector]) {
|
||||
indicies[extend.index + ' ' + selector] = true;
|
||||
logger.warn("extend '"+selector+"' has no matches");
|
||||
}
|
||||
});
|
||||
},
|
||||
doExtendChaining: function (extendsList, extendsListTarget, iterationCount) {
|
||||
|
||||
Reference in New Issue
Block a user