mediawiki.log: Remove call to console.trace() for each warning
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 26 Jun 2015 08:45:32 +0000 (09:45 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sat, 27 Jun 2015 12:40:13 +0000 (14:40 +0200)
When code that accesses a deprecated property is called multiple times,
every time a deprecation message is logged and a stack trace produced.

And all synchronously as well. This creates a duplicative mess in the
console.

Per T103891, T103610, and reports on IRC, this appears to have a
tendency to crash Firebug.

While less convenient, there are other ways to get the calling
function from a warning (e.g. debugger, breakpoints, pause/step
execution). We don't call it for mw.log.error, either.

This should help reduce noise, speed up execution path, and hopefully
prevent such crashes in the future.

Change-Id: I80428a5e80dbb84b93be2f10340fe29d9bef12d3

resources/src/mediawiki/mediawiki.js

index a815c99..2c88e93 100644 (file)
 
                        /**
                         * Write a message the console's warning channel.
-                        * Also logs a stacktrace for easier debugging.
                         * Actions not supported by the browser console are silently ignored.
                         *
                         * @param {string...} msg Messages to output to console
                                var console = window.console;
                                if ( console && console.warn && console.warn.apply ) {
                                        console.warn.apply( console, arguments );
-                                       if ( console.trace ) {
-                                               console.trace();
-                                       }
                                }
                        };