From fb11be8c45b69c07f27b99a45d04d852fe2415f3 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 15 Sep 2018 19:38:22 +0100 Subject: [PATCH] resourceloader: Simplify StringSet fallback Covered by tests. Change-Id: I6a287f27d0830561275bf0be525992c59cbe441f --- resources/src/startup/mediawiki.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) 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; - }() ); + }; } /** -- 2.20.1