mw.log.deprecate: Use mw.log.warn instead of log.warn
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 28 Feb 2014 20:15:06 +0000 (21:15 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 28 Feb 2014 20:15:06 +0000 (21:15 +0100)
In qunit/testrunner.js, freshConfigCopy() temporarily clears
mw.log.warn to avoid a flood of spurious deprecation warnings.

However, as of 89a8fe4, the console was once again flooded with
deprecated notices when in debug mode because in debug mode we
load mediawiki.log.js which redefines the mw.log object and as
such the local reference here kept pointing to the original.

Change-Id: I2b560aac9c0b929c82bb628760c194c0476fe1a9

resources/mediawiki/mediawiki.js

index 8b78370..bf5ad22 100644 (file)
@@ -566,12 +566,12 @@ var mw = ( function ( $, undefined ) {
                                                enumerable: true,
                                                get: function () {
                                                        mw.track( 'mw.deprecate', key );
-                                                       log.warn( msg );
+                                                       mw.log.warn( msg );
                                                        return val;
                                                },
                                                set: function ( newVal ) {
                                                        mw.track( 'mw.deprecate', key );
-                                                       log.warn( msg );
+                                                       mw.log.warn( msg );
                                                        val = newVal;
                                                }
                                        } );