Merge "resourceloader: Simplify StringSet fallback"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 20 Sep 2018 07:58:03 +0000 (07:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 20 Sep 2018 07:58:03 +0000 (07:58 +0000)
resources/src/startup/mediawiki.js

index 97fc027..fee69c0 100644 (file)
 
        function defineFallbacks() {
                // <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set>
-               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;
-               }() );
+               };
        }
 
        /**