mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
better exception when discourse.ajax is called, still need to figure out how to fix it though :)
This commit is contained in:
@ -83,7 +83,11 @@ window.assetPath = function() { return null; };
|
|||||||
|
|
||||||
var oldAjax = $.ajax;
|
var oldAjax = $.ajax;
|
||||||
$.ajax = function() {
|
$.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);
|
return oldAjax.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user