examples/bower_components/polymer/polymer.js
function(matches, callback) {
      var inflight = matches.length;

      // return early if there is no fetching to be done
      if (!inflight) {
        return callback();
      }

      // wait for all subrequests to return
      var done = function() {
        if (--inflight === 0) {
          callback();
        }
      };

      // start fetching all subrequests
      var m, req, url;
      for (var i = 0; i < inflight; i++) {
        m = matches[i];
        url = m.url;
        req = this.cache[url];
        // if this url has already been requested, skip requesting it again
        if (!req) {
          req = this.xhr(url);
          req.match = m;
          this.cache[url] = req;
        }
        // wait for the request to process its subrequests
        req.wait(done);
      }
    }
function(matches, callback) {
      var inflight = matches.length;

      // return early if there is no fetching to be done
      if (!inflight) {
        return callback();
      }

      // wait for all subrequests to return
      var done = function() {
        if (--inflight === 0) {
          callback();
        }
      };

      // start fetching all subrequests
      var m, req, url;
      for (var i = 0; i < inflight; i++) {
        m = matches[i];
        url = m.url;
        req = this.cache[url];
        // if this url has already been requested, skip requesting it again
        if (!req) {
          req = this.xhr(url);
          req.match = m;
          this.cache[url] = req;
        }
        // wait for the request to process its subrequests
        req.wait(done);
      }
    }
function ( matches , callback ) { var inflight = matches . length ; // return early if there is no fetching to be done if ( ! inflight ) { return callback ( ) ; } // wait for all subrequests to return var done = function ( ) { if ( -- inflight === 0 ) { callback ( ) ; } } ; // start fetching all subrequests var m , req , url ; for ( var i = 0 ; i < inflight ; i ++ ) { m = matches [ i ] ; url = m . url ; req = this . cache [ url ] ; // if this url has already been requested, skip requesting it again if ( ! req ) { req = this . xhr ( url ) ; req . match = m ; this . cache [ url ] = req ; } // wait for the request to process its subrequests req . wait ( done ) ; } }
build a mapping of url -> text from matches
build a mapping of url - > text from matches