Swtiched to using console.log if present so that when errors occur inside of modules...
authorTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 29 Mar 2011 22:08:57 +0000 (22:08 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 29 Mar 2011 22:08:57 +0000 (22:08 +0000)
resources/mediawiki/mediawiki.js

index fb68e3b..21e854f 100644 (file)
@@ -718,8 +718,12 @@ window.mediaWiki = new ( function( $ ) {
                                        }
                                }
                        } catch ( e ) {
-                               mw.log( _fn + 'Exception thrown by ' + module + ': ' + e.message );
-                               mw.log( e );
+                               // This needs to NOT use mw.log because these errors are common in production mode
+                               // and not in debug mode, such as when a symbol that should be global isn't exported
+                               if ( console && typeof console.log === 'function' ) {
+                                       console.log( _fn + 'Exception thrown by ' + module + ': ' + e.message );
+                                       console.log( e );
+                               }
                                registry[module].state = 'error';
                                // Run error callbacks of jobs affected by this condition
                                for ( var j = 0; j < jobs.length; j++ ) {