checkExtendsForNonMatched method

void checkExtendsForNonMatched(
  1. List<Extend> extendList
)

Implementation

void checkExtendsForNonMatched(List<Extend> extendList) {
  final indices = extendIndices;
  final logger = Logger();

  extendList
    ..retainWhere((Extend extend) =>
        !extend.hasFoundMatches && extend.parentIds.length == 1)
    ..forEach((Extend extend) {
      var selector = '_unknown_';

      try {
        selector = extend.selector.toCSS(Contexts());
      } catch (_) {}

      final key = '${extend.index.toString()} $selector';
      if (!indices.containsKey(key)) {
        indices[key] = true;
        logger.warn("extend '$selector' has no matches");
      }
    });

//2.6.1 20160401
// checkExtendsForNonMatched: function(extendList) {
//     var indices = this.extendIndices;
//     extendList.filter(function(extend) {
//         return !extend.hasFoundMatches && extend.parent_ids.length == 1;
//     }).forEach(function(extend) {
//             var selector = "_unknown_";
//             try {
//                 selector = extend.selector.toCSS({});
//             }
//             catch(_) {}
//
//             if (!indices[extend.index + ' ' + selector]) {
//                 indices[extend.index + ' ' + selector] = true;
//                 logger.warn("extend '" + selector + "' has no matches");
//             }
//         });
// },
}