[Pkg-javascript-commits] [less.js] 20/58: checking for doubles when warning for empty extends

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:28:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.3.0
in repository less.js.

commit 5551c40662b19df3466c1cb24e8d5a0fdb5f6a15
Author: Stefan Baumgartner <sbaumg at gmail.com>
Date:   Tue Jan 13 11:11:47 2015 +0100

    checking for doubles when warning for empty extends
    
    follow up #2369
---
 lib/less/visitors/extend-visitor.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/less/visitors/extend-visitor.js b/lib/less/visitors/extend-visitor.js
index 5792ef3..2aaba72 100644
--- a/lib/less/visitors/extend-visitor.js
+++ b/lib/less/visitors/extend-visitor.js
@@ -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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list