save last call for improve testing

This commit is contained in:
javi 2013-10-15 10:40:53 +02:00
parent a75aa736d0
commit ba4bb63f53

View File

@ -2,8 +2,10 @@
var torque = exports.torque = exports.torque || {}; var torque = exports.torque = exports.torque || {};
torque.net = torque.net || {}; torque.net = torque.net || {};
var lastCall = null;
function get(url, callback) { function get(url, callback) {
lastCall = { url: url, callback: callback };
var request = XMLHttpRequest; var request = XMLHttpRequest;
// from d3.js // from d3.js
if (window.XDomainRequest if (window.XDomainRequest
@ -32,7 +34,8 @@
} }
torque.net = { torque.net = {
get: get get: get,
lastCall: function() { return lastCall; }
}; };
})(typeof exports === "undefined" ? this : exports); })(typeof exports === "undefined" ? this : exports);