mediawiki.log: Fix unknown method "apply" error in IE9 and below
authorGilles Dubuc <gdubuc@wikimedia.org>
Mon, 31 Mar 2014 13:57:05 +0000 (15:57 +0200)
committerKrinkle <krinklemail@gmail.com>
Mon, 31 Mar 2014 22:20:21 +0000 (22:20 +0000)
In IE < 10, the console.log function is implemented as a non-standard
host function (not inheriting the regular Function prototype) which
doesn't provide an "apply" method.

Change-Id: I6ecf933589ec430ff4d1748a5f3c511b692e3b9a

resources/mediawiki/mediawiki.log.js

index dd22e35..2ca0bbd 100644 (file)
@@ -33,7 +33,7 @@
                // Try to use an existing console
                // Generally we can cache this, but in this case we want to re-evaluate this as a
                // global property live so that things like Firebug Lite can take precedence.
-               if ( window.console && window.console.log ) {
+               if ( window.console && window.console.log && window.console.log.apply ) {
                        args.unshift( prefix );
                        window.console.log.apply( window.console, args );
                        return;