/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['patch.js']) {
  _$jscoverage['patch.js'] = [];
  _$jscoverage['patch.js'][12] = 0;
  _$jscoverage['patch.js'][20] = 0;
  _$jscoverage['patch.js'][30] = 0;
  _$jscoverage['patch.js'][31] = 0;
  _$jscoverage['patch.js'][43] = 0;
  _$jscoverage['patch.js'][44] = 0;
  _$jscoverage['patch.js'][48] = 0;
  _$jscoverage['patch.js'][49] = 0;
  _$jscoverage['patch.js'][50] = 0;
  _$jscoverage['patch.js'][55] = 0;
  _$jscoverage['patch.js'][56] = 0;
  _$jscoverage['patch.js'][59] = 0;
  _$jscoverage['patch.js'][66] = 0;
  _$jscoverage['patch.js'][67] = 0;
  _$jscoverage['patch.js'][68] = 0;
  _$jscoverage['patch.js'][69] = 0;
  _$jscoverage['patch.js'][72] = 0;
  _$jscoverage['patch.js'][73] = 0;
  _$jscoverage['patch.js'][74] = 0;
  _$jscoverage['patch.js'][75] = 0;
  _$jscoverage['patch.js'][78] = 0;
}
_$jscoverage['patch.js'][12]++;
var http = require("http"), res = http.ServerResponse.prototype, setHeader = res.setHeader, _renderHeaders = res._renderHeaders, writeHead = res.writeHead;
_$jscoverage['patch.js'][20]++;
if (! res._hasConnectPatch) {
  _$jscoverage['patch.js'][30]++;
  res.__defineGetter__("headerSent", (function () {
  _$jscoverage['patch.js'][31]++;
  return this._header;
}));
  _$jscoverage['patch.js'][43]++;
  res.setHeader = (function (field, val) {
  _$jscoverage['patch.js'][44]++;
  var key = field.toLowerCase(), prev;
  _$jscoverage['patch.js'][48]++;
  if (this._headers && "set-cookie" == key) {
    _$jscoverage['patch.js'][49]++;
    if (prev = this.getHeader(field)) {
      _$jscoverage['patch.js'][50]++;
      val = Array.isArray(prev)? prev.concat(val): [prev, val];
    }
  }
  else {
    _$jscoverage['patch.js'][55]++;
    if ("content-type" == key && this.charset) {
      _$jscoverage['patch.js'][56]++;
      val += "; charset=" + this.charset;
    }
  }
  _$jscoverage['patch.js'][59]++;
  return setHeader.call(this, field, val);
});
  _$jscoverage['patch.js'][66]++;
  res._renderHeaders = (function () {
  _$jscoverage['patch.js'][67]++;
  if (! this._emittedHeader) {
    _$jscoverage['patch.js'][67]++;
    this.emit("header");
  }
  _$jscoverage['patch.js'][68]++;
  this._emittedHeader = true;
  _$jscoverage['patch.js'][69]++;
  return _renderHeaders.call(this);
});
  _$jscoverage['patch.js'][72]++;
  res.writeHead = (function () {
  _$jscoverage['patch.js'][73]++;
  if (! this._emittedHeader) {
    _$jscoverage['patch.js'][73]++;
    this.emit("header");
  }
  _$jscoverage['patch.js'][74]++;
  this._emittedHeader = true;
  _$jscoverage['patch.js'][75]++;
  return writeHead.apply(this, arguments);
});
  _$jscoverage['patch.js'][78]++;
  res._hasConnectPatch = true;
}
_$jscoverage['patch.js'].source = ["","/*!"," * Connect"," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var http = require('http')","  , res = http.ServerResponse.prototype","  , setHeader = res.setHeader","  , _renderHeaders = res._renderHeaders","  , writeHead = res.writeHead;","","// apply only once","","if (!res._hasConnectPatch) {","","  /**","   * Provide a public \"header sent\" flag","   * until node does.","   *","   * @return {Boolean}","   * @api public","   */","","  res.__defineGetter__('headerSent', function(){","    return this._header;","  });","","  /**","   * Set header `field` to `val`, special-casing","   * the `Set-Cookie` field for multiple support.","   *","   * @param {String} field","   * @param {String} val","   * @api public","   */","","  res.setHeader = function(field, val){","    var key = field.toLowerCase()","      , prev;","","    // special-case Set-Cookie","    if (this._headers &amp;&amp; 'set-cookie' == key) {","      if (prev = this.getHeader(field)) {","        val = Array.isArray(prev)","          ? prev.concat(val)","          : [prev, val];","      }","    // charset","    } else if ('content-type' == key &amp;&amp; this.charset) {","      val += '; charset=' + this.charset;","    }","","    return setHeader.call(this, field, val);","  };","","  /**","   * Proxy to emit \"header\" event.","   */","","  res._renderHeaders = function(){","    if (!this._emittedHeader) this.emit('header');","    this._emittedHeader = true;","    return _renderHeaders.call(this);","  };","","  res.writeHead = function(){","    if (!this._emittedHeader) this.emit('header');","    this._emittedHeader = true;","    return writeHead.apply(this, arguments);","  };","","  res._hasConnectPatch = true;","}"];
