From: jenkins-bot Date: Thu, 20 Sep 2018 07:58:03 +0000 (+0000) Subject: Merge "resourceloader: Simplify StringSet fallback" X-Git-Tag: 1.34.0-rc.0~4046 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=2f5d88819799f077f4d3a3288dad104141692f20;hp=-c Merge "resourceloader: Simplify StringSet fallback" --- 2f5d88819799f077f4d3a3288dad104141692f20 diff --combined resources/src/startup/mediawiki.js index 97fc02783a,29f74455ba..fee69c07bf --- a/resources/src/startup/mediawiki.js +++ b/resources/src/startup/mediawiki.js @@@ -48,22 -48,19 +48,19 @@@ function defineFallbacks() { // - StringSet = window.Set || ( function () { - /** - * @private - * @class - */ - function StringSet() { - this.set = Object.create( null ); - } - StringSet.prototype.add = function ( value ) { - this.set[ value ] = true; + /** + * @private + * @class + */ + StringSet = window.Set || function StringSet() { + var set = Object.create( null ); + this.add = function ( value ) { + set[ value ] = true; }; - StringSet.prototype.has = function ( value ) { - return value in this.set; + this.has = function ( value ) { + return value in set; }; - return StringSet; - }() ); + }; } /** @@@ -258,6 -255,7 +255,6 @@@ defineFallbacks(); - /* eslint-disable no-console */ log = ( function () { /** * Write a verbose message to the browser's console in debug mode. @@@ -291,7 -289,7 +288,7 @@@ * * @param {...string} msg Messages to output to console */ - log.warn = console && console.warn && Function.prototype.bind ? + log.warn = console && console.warn ? Function.prototype.bind.call( console.warn, console ) : function () {}; @@@ -306,7 -304,7 +303,7 @@@ * @since 1.26 * @param {...Mixed} msg Messages to output to console */ - log.error = console && console.error && Function.prototype.bind ? + log.error = console && console.error ? Function.prototype.bind.call( console.error, console ) : function () {}; @@@ -321,7 -319,9 +318,7 @@@ * @param {string} [logName=key] Optional custom name for the feature. * This is used instead of `key` in the message and `mw.deprecate` tracking. */ - log.deprecate = !Object.defineProperty ? function ( obj, key, val ) { - obj[ key ] = val; - } : function ( obj, key, val, msg, logName ) { + log.deprecate = function ( obj, key, val, msg, logName ) { var stacks; function maybeLog() { var name, @@@ -361,6 -361,7 +358,6 @@@ return log; }() ); - /* eslint-enable no-console */ /** * @class mw