/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['express 3.0.6/router/index.js']) {
  _$jscoverage['express 3.0.6/router/index.js'] = [];
  _$jscoverage['express 3.0.6/router/index.js'][5] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][15] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][24] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][25] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][26] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][27] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][28] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][29] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][30] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][31] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][32] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][33] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][46] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][48] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][49] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][50] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][54] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][58] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][59] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][60] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][66] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][67] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][70] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][71] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][83] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][84] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][87] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][90] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][91] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][99] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][100] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][104] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][107] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][108] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][112] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][113] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][114] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][117] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][118] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][119] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][120] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][121] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][123] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][124] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][125] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][126] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][127] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][128] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][129] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][130] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][131] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][132] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][134] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][135] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][138] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][140] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][142] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][145] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][146] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][147] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][148] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][152] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][153] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][154] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][155] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][156] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][157] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][158] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][159] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][160] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][161] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][162] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][164] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][167] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][184] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][185] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][193] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][194] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][195] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][196] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][200] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][203] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][204] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][205] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][206] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][207] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][225] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][226] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][227] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][240] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][241] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][245] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][248] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][249] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][250] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][251] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][252] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][256] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][257] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][263] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][264] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][267] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][268] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][269] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][270] = 0;
  _$jscoverage['express 3.0.6/router/index.js'][271] = 0;
}
_$jscoverage['express 3.0.6/router/index.js'][5]++;
var Route = require("./route"), utils = require("../utils"), methods = require("methods"), debug = require("debug")("express:router"), parse = require("connect").utils.parseUrl;
_$jscoverage['express 3.0.6/router/index.js'][15]++;
exports = module.exports = Router;
_$jscoverage['express 3.0.6/router/index.js'][24]++;
function Router(options) {
  _$jscoverage['express 3.0.6/router/index.js'][25]++;
  options = options || {};
  _$jscoverage['express 3.0.6/router/index.js'][26]++;
  var self = this;
  _$jscoverage['express 3.0.6/router/index.js'][27]++;
  this.map = {};
  _$jscoverage['express 3.0.6/router/index.js'][28]++;
  this.params = {};
  _$jscoverage['express 3.0.6/router/index.js'][29]++;
  this._params = [];
  _$jscoverage['express 3.0.6/router/index.js'][30]++;
  this.caseSensitive = options.caseSensitive;
  _$jscoverage['express 3.0.6/router/index.js'][31]++;
  this.strict = options.strict;
  _$jscoverage['express 3.0.6/router/index.js'][32]++;
  this.middleware = (function router(req, res, next) {
  _$jscoverage['express 3.0.6/router/index.js'][33]++;
  self._dispatch(req, res, next);
});
}
_$jscoverage['express 3.0.6/router/index.js'][46]++;
Router.prototype.param = (function (name, fn) {
  _$jscoverage['express 3.0.6/router/index.js'][48]++;
  if ("function" == typeof name) {
    _$jscoverage['express 3.0.6/router/index.js'][49]++;
    this._params.push(name);
    _$jscoverage['express 3.0.6/router/index.js'][50]++;
    return;
  }
  _$jscoverage['express 3.0.6/router/index.js'][54]++;
  var params = this._params, len = params.length, ret;
  _$jscoverage['express 3.0.6/router/index.js'][58]++;
  for (var i = 0; i < len; ++i) {
    _$jscoverage['express 3.0.6/router/index.js'][59]++;
    if (ret = params[i](name, fn)) {
      _$jscoverage['express 3.0.6/router/index.js'][60]++;
      fn = ret;
    }
}
  _$jscoverage['express 3.0.6/router/index.js'][66]++;
  if ("function" != typeof fn) {
    _$jscoverage['express 3.0.6/router/index.js'][67]++;
    throw new Error("invalid param() call for " + name + ", got " + fn);
  }
  _$jscoverage['express 3.0.6/router/index.js'][70]++;
  (this.params[name] = this.params[name] || []).push(fn);
  _$jscoverage['express 3.0.6/router/index.js'][71]++;
  return this;
});
_$jscoverage['express 3.0.6/router/index.js'][83]++;
Router.prototype._dispatch = (function (req, res, next) {
  _$jscoverage['express 3.0.6/router/index.js'][84]++;
  var params = this.params, self = this;
  _$jscoverage['express 3.0.6/router/index.js'][87]++;
  debug("dispatching %s %s (%s)", req.method, req.url, req.originalUrl);
  _$jscoverage['express 3.0.6/router/index.js'][90]++;
  (function pass(i, err) {
  _$jscoverage['express 3.0.6/router/index.js'][91]++;
  var paramCallbacks, paramIndex = 0, paramVal, route, keys, key;
  _$jscoverage['express 3.0.6/router/index.js'][99]++;
  function nextRoute(err) {
    _$jscoverage['express 3.0.6/router/index.js'][100]++;
    pass(req._route_index + 1, err);
}
  _$jscoverage['express 3.0.6/router/index.js'][104]++;
  req.route = route = self.matchRequest(req, i);
  _$jscoverage['express 3.0.6/router/index.js'][107]++;
  if (! route) {
    _$jscoverage['express 3.0.6/router/index.js'][107]++;
    return next(err);
  }
  _$jscoverage['express 3.0.6/router/index.js'][108]++;
  debug("matched %s %s", route.method, route.path);
  _$jscoverage['express 3.0.6/router/index.js'][112]++;
  req.params = route.params;
  _$jscoverage['express 3.0.6/router/index.js'][113]++;
  keys = route.keys;
  _$jscoverage['express 3.0.6/router/index.js'][114]++;
  i = 0;
  _$jscoverage['express 3.0.6/router/index.js'][117]++;
  function param(err) {
    _$jscoverage['express 3.0.6/router/index.js'][118]++;
    paramIndex = 0;
    _$jscoverage['express 3.0.6/router/index.js'][119]++;
    key = keys[i++];
    _$jscoverage['express 3.0.6/router/index.js'][120]++;
    paramVal = key && req.params[key.name];
    _$jscoverage['express 3.0.6/router/index.js'][121]++;
    paramCallbacks = key && params[key.name];
    _$jscoverage['express 3.0.6/router/index.js'][123]++;
    try {
      _$jscoverage['express 3.0.6/router/index.js'][124]++;
      if ("route" == err) {
        _$jscoverage['express 3.0.6/router/index.js'][125]++;
        nextRoute();
      }
      else {
        _$jscoverage['express 3.0.6/router/index.js'][126]++;
        if (err) {
          _$jscoverage['express 3.0.6/router/index.js'][127]++;
          i = 0;
          _$jscoverage['express 3.0.6/router/index.js'][128]++;
          callbacks(err);
        }
        else {
          _$jscoverage['express 3.0.6/router/index.js'][129]++;
          if (paramCallbacks && undefined !== paramVal) {
            _$jscoverage['express 3.0.6/router/index.js'][130]++;
            paramCallback();
          }
          else {
            _$jscoverage['express 3.0.6/router/index.js'][131]++;
            if (key) {
              _$jscoverage['express 3.0.6/router/index.js'][132]++;
              param();
            }
            else {
              _$jscoverage['express 3.0.6/router/index.js'][134]++;
              i = 0;
              _$jscoverage['express 3.0.6/router/index.js'][135]++;
              callbacks();
            }
          }
        }
      }
    }
    catch (err) {
      _$jscoverage['express 3.0.6/router/index.js'][138]++;
      param(err);
    }
}
  _$jscoverage['express 3.0.6/router/index.js'][140]++;
  ;
  _$jscoverage['express 3.0.6/router/index.js'][142]++;
  param(err);
  _$jscoverage['express 3.0.6/router/index.js'][145]++;
  function paramCallback(err) {
    _$jscoverage['express 3.0.6/router/index.js'][146]++;
    var fn = paramCallbacks[paramIndex++];
    _$jscoverage['express 3.0.6/router/index.js'][147]++;
    if (err || ! fn) {
      _$jscoverage['express 3.0.6/router/index.js'][147]++;
      return param(err);
    }
    _$jscoverage['express 3.0.6/router/index.js'][148]++;
    fn(req, res, paramCallback, paramVal, key.name);
}
  _$jscoverage['express 3.0.6/router/index.js'][152]++;
  function callbacks(err) {
    _$jscoverage['express 3.0.6/router/index.js'][153]++;
    var fn = route.callbacks[i++];
    _$jscoverage['express 3.0.6/router/index.js'][154]++;
    try {
      _$jscoverage['express 3.0.6/router/index.js'][155]++;
      if ("route" == err) {
        _$jscoverage['express 3.0.6/router/index.js'][156]++;
        nextRoute();
      }
      else {
        _$jscoverage['express 3.0.6/router/index.js'][157]++;
        if (err && fn) {
          _$jscoverage['express 3.0.6/router/index.js'][158]++;
          if (fn.length < 4) {
            _$jscoverage['express 3.0.6/router/index.js'][158]++;
            return callbacks(err);
          }
          _$jscoverage['express 3.0.6/router/index.js'][159]++;
          fn(err, req, res, callbacks);
        }
        else {
          _$jscoverage['express 3.0.6/router/index.js'][160]++;
          if (fn) {
            _$jscoverage['express 3.0.6/router/index.js'][161]++;
            if (fn.length < 4) {
              _$jscoverage['express 3.0.6/router/index.js'][161]++;
              return fn(req, res, callbacks);
            }
            _$jscoverage['express 3.0.6/router/index.js'][162]++;
            callbacks();
          }
          else {
            _$jscoverage['express 3.0.6/router/index.js'][164]++;
            nextRoute(err);
          }
        }
      }
    }
    catch (err) {
      _$jscoverage['express 3.0.6/router/index.js'][167]++;
      callbacks(err);
    }
}
})(0);
});
_$jscoverage['express 3.0.6/router/index.js'][184]++;
Router.prototype.matchRequest = (function (req, i, head) {
  _$jscoverage['express 3.0.6/router/index.js'][185]++;
  var method = req.method.toLowerCase(), url = parse(req), path = url.pathname, routes = this.map, i = i || 0, route;
  _$jscoverage['express 3.0.6/router/index.js'][193]++;
  if (! head && "head" == method) {
    _$jscoverage['express 3.0.6/router/index.js'][194]++;
    route = this.matchRequest(req, i, true);
    _$jscoverage['express 3.0.6/router/index.js'][195]++;
    if (route) {
      _$jscoverage['express 3.0.6/router/index.js'][195]++;
      return route;
    }
    _$jscoverage['express 3.0.6/router/index.js'][196]++;
    method = "get";
  }
  _$jscoverage['express 3.0.6/router/index.js'][200]++;
  if (routes = routes[method]) {
    _$jscoverage['express 3.0.6/router/index.js'][203]++;
    for (var len = routes.length; i < len; ++i) {
      _$jscoverage['express 3.0.6/router/index.js'][204]++;
      route = routes[i];
      _$jscoverage['express 3.0.6/router/index.js'][205]++;
      if (route.match(path)) {
        _$jscoverage['express 3.0.6/router/index.js'][206]++;
        req._route_index = i;
        _$jscoverage['express 3.0.6/router/index.js'][207]++;
        return route;
      }
}
  }
});
_$jscoverage['express 3.0.6/router/index.js'][225]++;
Router.prototype.match = (function (method, url, i, head) {
  _$jscoverage['express 3.0.6/router/index.js'][226]++;
  var req = {method: method, url: url};
  _$jscoverage['express 3.0.6/router/index.js'][227]++;
  return this.matchRequest(req, i, head);
});
_$jscoverage['express 3.0.6/router/index.js'][240]++;
Router.prototype.route = (function (method, path, callbacks) {
  _$jscoverage['express 3.0.6/router/index.js'][241]++;
  var method = method.toLowerCase(), callbacks = utils.flatten([].slice.call(arguments, 2));
  _$jscoverage['express 3.0.6/router/index.js'][245]++;
  if (! path) {
    _$jscoverage['express 3.0.6/router/index.js'][245]++;
    throw new Error("Router#" + method + "() requires a path");
  }
  _$jscoverage['express 3.0.6/router/index.js'][248]++;
  callbacks.forEach((function (fn, i) {
  _$jscoverage['express 3.0.6/router/index.js'][249]++;
  if ("function" == typeof fn) {
    _$jscoverage['express 3.0.6/router/index.js'][249]++;
    return;
  }
  _$jscoverage['express 3.0.6/router/index.js'][250]++;
  var type = ({}).toString.call(fn);
  _$jscoverage['express 3.0.6/router/index.js'][251]++;
  var msg = "." + method + "() requires callback functions but got a " + type;
  _$jscoverage['express 3.0.6/router/index.js'][252]++;
  throw new Error(msg);
}));
  _$jscoverage['express 3.0.6/router/index.js'][256]++;
  debug("defined %s %s", method, path);
  _$jscoverage['express 3.0.6/router/index.js'][257]++;
  var route = new Route(method, path, callbacks, {sensitive: this.caseSensitive, strict: this.strict});
  _$jscoverage['express 3.0.6/router/index.js'][263]++;
  (this.map[method] = this.map[method] || []).push(route);
  _$jscoverage['express 3.0.6/router/index.js'][264]++;
  return this;
});
_$jscoverage['express 3.0.6/router/index.js'][267]++;
methods.forEach((function (method) {
  _$jscoverage['express 3.0.6/router/index.js'][268]++;
  Router.prototype[method] = (function (path) {
  _$jscoverage['express 3.0.6/router/index.js'][269]++;
  var args = [method].concat([].slice.call(arguments));
  _$jscoverage['express 3.0.6/router/index.js'][270]++;
  this.route.apply(this, args);
  _$jscoverage['express 3.0.6/router/index.js'][271]++;
  return this;
});
}));
_$jscoverage['express 3.0.6/router/index.js'].source = ["/**"," * Module dependencies."," */","","var Route = require('./route')","  , utils = require('../utils')","  , methods = require('methods')","  , debug = require('debug')('express:router')","  , parse = require('connect').utils.parseUrl;","","/**"," * Expose `Router` constructor."," */","","exports = module.exports = Router;","","/**"," * Initialize a new `Router` with the given `options`."," *"," * @param {Object} options"," * @api private"," */","","function Router(options) {","  options = options || {};","  var self = this;","  this.map = {};","  this.params = {};","  this._params = [];","  this.caseSensitive = options.caseSensitive;","  this.strict = options.strict;","  this.middleware = function router(req, res, next){","    self._dispatch(req, res, next);","  };","}","","/**"," * Register a param callback `fn` for the given `name`."," *"," * @param {String|Function} name"," * @param {Function} fn"," * @return {Router} for chaining"," * @api public"," */","","Router.prototype.param = function(name, fn){","  // param logic","  if ('function' == typeof name) {","    this._params.push(name);","    return;","  }","","  // apply param functions","  var params = this._params","    , len = params.length","    , ret;","","  for (var i = 0; i &lt; len; ++i) {","    if (ret = params[i](name, fn)) {","      fn = ret;","    }","  }","","  // ensure we end up with a","  // middleware function","  if ('function' != typeof fn) {","    throw new Error('invalid param() call for ' + name + ', got ' + fn);","  }","","  (this.params[name] = this.params[name] || []).push(fn);","  return this;","};","","/**"," * Route dispatcher aka the route \"middleware\"."," *"," * @param {IncomingMessage} req"," * @param {ServerResponse} res"," * @param {Function} next"," * @api private"," */","","Router.prototype._dispatch = function(req, res, next){","  var params = this.params","    , self = this;","","  debug('dispatching %s %s (%s)', req.method, req.url, req.originalUrl);","","  // route dispatch","  (function pass(i, err){","    var paramCallbacks","      , paramIndex = 0","      , paramVal","      , route","      , keys","      , key;","","    // match next route","    function nextRoute(err) {","      pass(req._route_index + 1, err);","    }","","    // match route","    req.route = route = self.matchRequest(req, i);","","    // no route","    if (!route) return next(err);","    debug('matched %s %s', route.method, route.path);","","    // we have a route","    // start at param 0","    req.params = route.params;","    keys = route.keys;","    i = 0;","","    // param callbacks","    function param(err) {","      paramIndex = 0;","      key = keys[i++];","      paramVal = key &amp;&amp; req.params[key.name];","      paramCallbacks = key &amp;&amp; params[key.name];","","      try {","        if ('route' == err) {","          nextRoute();","        } else if (err) {","          i = 0;","          callbacks(err);","        } else if (paramCallbacks &amp;&amp; undefined !== paramVal) {","          paramCallback();","        } else if (key) {","          param();","        } else {","          i = 0;","          callbacks();","        }","      } catch (err) {","        param(err);","      }","    };","","    param(err);","","    // single param callbacks","    function paramCallback(err) {","      var fn = paramCallbacks[paramIndex++];","      if (err || !fn) return param(err);","      fn(req, res, paramCallback, paramVal, key.name);","    }","","    // invoke route callbacks","    function callbacks(err) {","      var fn = route.callbacks[i++];","      try {","        if ('route' == err) {","          nextRoute();","        } else if (err &amp;&amp; fn) {","          if (fn.length &lt; 4) return callbacks(err);","          fn(err, req, res, callbacks);","        } else if (fn) {","          if (fn.length &lt; 4) return fn(req, res, callbacks);","          callbacks();","        } else {","          nextRoute(err);","        }","      } catch (err) {","        callbacks(err);","      }","    }","  })(0);","};","","/**"," * Attempt to match a route for `req`"," * with optional starting index of `i`"," * defaulting to 0."," *"," * @param {IncomingMessage} req"," * @param {Number} i"," * @return {Route}"," * @api private"," */","","Router.prototype.matchRequest = function(req, i, head){","  var method = req.method.toLowerCase()","    , url = parse(req)","    , path = url.pathname","    , routes = this.map","    , i = i || 0","    , route;","","  // HEAD support","  if (!head &amp;&amp; 'head' == method) {","    route = this.matchRequest(req, i, true);","    if (route) return route;","     method = 'get';","  }","","  // routes for this method","  if (routes = routes[method]) {","","    // matching routes","    for (var len = routes.length; i &lt; len; ++i) {","      route = routes[i];","      if (route.match(path)) {","        req._route_index = i;","        return route;","      }","    }","  }","};","","/**"," * Attempt to match a route for `method`"," * and `url` with optional starting"," * index of `i` defaulting to 0."," *"," * @param {String} method"," * @param {String} url"," * @param {Number} i"," * @return {Route}"," * @api private"," */","","Router.prototype.match = function(method, url, i, head){","  var req = { method: method, url: url };","  return  this.matchRequest(req, i, head);","};","","/**"," * Route `method`, `path`, and one or more callbacks."," *"," * @param {String} method"," * @param {String} path"," * @param {Function} callback..."," * @return {Router} for chaining"," * @api private"," */","","Router.prototype.route = function(method, path, callbacks){","  var method = method.toLowerCase()","    , callbacks = utils.flatten([].slice.call(arguments, 2));","","  // ensure path was given","  if (!path) throw new Error('Router#' + method + '() requires a path');","","  // ensure all callbacks are functions","  callbacks.forEach(function(fn, i){","    if ('function' == typeof fn) return;","    var type = {}.toString.call(fn);","    var msg = '.' + method + '() requires callback functions but got a ' + type;","    throw new Error(msg);","  });","","  // create the route","  debug('defined %s %s', method, path);","  var route = new Route(method, path, callbacks, {","    sensitive: this.caseSensitive,","    strict: this.strict","  });","","  // add it","  (this.map[method] = this.map[method] || []).push(route);","  return this;","};","","methods.forEach(function(method){","  Router.prototype[method] = function(path){","    var args = [method].concat([].slice.call(arguments));","    this.route.apply(this, args);","    return this;","  };","});"];
