startup/mediawiki.js currently checks if console.warn is truthy, and if so binds mw.log.warn to it, and if not make mw.log.warn a no-op:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/1683136df1e6b20e5c12453671dad98b9425fc22/resources/src/startup/mediawiki.js#169
/** * Write a message to the browser console's warning channel. * * This method is a no-op in browsers that don't implement the Console API. * * @param {...string} msg Messages to output to console */ log.warn = con.warn ? Function.prototype.bind.call( con.warn, con ) : function () {};
based on the browser support at https://www.mediawiki.org/wiki/Compatibility#Browser_support_matrix and caniuse for console operations (https://caniuse.com/mdn-api_console_warn) it appears that all supported browsers implement the console API, and specifically the warn method. Can the check be removed?