better exception when discourse.ajax is called, still need to figure out how to fix it though :)

This commit is contained in:
Sam 2013-10-25 14:30:45 +11:00
parent a65407b2cb
commit e57967c6c3

View File

@ -83,7 +83,11 @@ window.assetPath = function() { return null; };
var oldAjax = $.ajax;
$.ajax = function() {
console.error("Discourse.Ajax called in test environment (" + arguments[0] + ")");
try {
this.undef();
} catch(e) {
console.error("Discourse.Ajax called in test environment (" + arguments[0] + ")\n caller: " + e.stack.split("\n").slice(2).join("\n"));
}
return oldAjax.apply(this, arguments);
};