liberapay.com/js/console.js
2014-08-03 14:14:48 +02:00

21 lines
621 B
JavaScript

// Degrade the console obj where not present.
// ==========================================
// http://fbug.googlecode.com/svn/branches/firebug1.2/lite/firebugx.js
// Relaxed to allow for Chrome's console.
function mock_console()
{
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count",
"trace", "profile", "profileEnd"];
window.console = {};
var mock = function() {};
for (var i=0, name; name = names[i]; i++)
window.console[name] = mock;
}
if (!window.console)
{
mock_console();
}