Skip to content
Browse files

Fixed issue #259 - updated console stub to work with Firebug 1.9 and …

…deleted unused Firebug Lite script.
  • Loading branch information...
1 parent 75d396d commit b9592ca7caca24c265cab972daed178bcbba66b4 @mleibman committed Jan 20, 2012
Showing with 7 additions and 2,076 deletions.
  1. +0 −2,068 lib/firebug-lite.js
  2. +7 −8 lib/firebugx.js
View
2,068 lib/firebug-lite.js
0 additions, 2,068 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
15 lib/firebugx.js
@@ -1,10 +1,9 @@
+if (typeof console === "undefined" || typeof console.log === "undefined") {
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
+ "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
-if (!("console" in window) || !("firebug" in console))
-{
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
- "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
-
- window.console = {};
- for (var i = 0; i < names.length; ++i)
- window.console[names[i]] = function() {}
+ window.console = {};
+ for (var i = 0; i < names.length; ++i) {
+ window.console[names[i]] = function() {}
+ }
}

1 comment on commit b9592ca

@simonlindholm

All the listed console functions don't have to exist just because console.log does. For example, Firefox's console lacks assert, dirxml, count, profile, profileEnd. You should really do something like this instead:

if (!window.console) window.console = {};
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
for (var i = 0; i < names.length; ++i) {
if (!console[names[i]])
console[names[i]] = function() {};
}

Also, groupCollapsed, clear, table and exception are missing from the list.

Please sign in to comment.
Something went wrong with that request. Please try again.