21 lines
621 B
JavaScript
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();
|
|
}
|