aboutsummaryrefslogblamecommitdiffstats
path: root/lib/browser_fix/xhr.js
blob: aeb9bfaf7554d3b9f98339b7c29405d58a6ed229 (plain) (tree)


































                                                                   

/**
 * Module dependencies.
 */

var global = (function() { return this; })(); // jshint ignore:line

/**
 * XMLHttpRequest constructor.
 */

var XMLHttpRequest = window.XMLHttpRequest; // jshint ignore:line

/**
 * Module exports.
 */

module.exports.XMLHttpRequest = XMLHttpRequest ? xhr : null;

/**
 * XMLHttpRequest constructor.
 *
 * @param {Object) opts (optional)
 * @api public
 */

function xhr(obj) {
  var instance;

  instance = new XMLHttpRequest(obj);

  return instance;
}

if (XMLHttpRequest) xhr.prototype = XMLHttpRequest.prototype;