From: Timo Tijhof Date: Sat, 15 Sep 2018 18:38:22 +0000 (+0100) Subject: resourceloader: Simplify StringSet fallback X-Git-Tag: 1.34.0-rc.0~4046^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=fb11be8c45b69c07f27b99a45d04d852fe2415f3 resourceloader: Simplify StringSet fallback Covered by tests. Change-Id: I6a287f27d0830561275bf0be525992c59cbe441f --- diff --git a/resources/src/startup/mediawiki.js b/resources/src/startup/mediawiki.js index bb0408583e..29f74455ba 100644 --- a/resources/src/startup/mediawiki.js +++ b/resources/src/startup/mediawiki.js @@ -48,22 +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; - }() ); + }; } /**