Revert "Module storage: randomly choose between Function and $.globalEval"
authorOri.livneh <ori@wikimedia.org>
Wed, 11 Dec 2013 00:59:19 +0000 (00:59 +0000)
committerOri.livneh <ori@wikimedia.org>
Wed, 11 Dec 2013 01:00:30 +0000 (01:00 +0000)
Did not get a chance to deploy this.

This reverts commit a20333cc4da04775db04b33407c88b4ccb5e5e74.

Change-Id: I6937d54897477f1942a8a9c312324a39d2a3868d

resources/mediawiki/mediawiki.js

index 840a071..724ca5e 100644 (file)
@@ -1269,12 +1269,7 @@ var mw = ( function ( $, undefined ) {
                                                        }
                                                        return true;
                                                } );
-                                               if ( mw.loader.store.useFunction ) {
-                                                       /* jshint -W054 */
-                                                       new Function( concatSource.join( ';' ) )();
-                                               } else {
-                                                       $.globalEval( concatSource.join( ';' ) );
-                                               }
+                                               $.globalEval( concatSource.join( ';' ) );
                                        }
 
                                        // Early exit if there's nothing to load...
@@ -1821,7 +1816,6 @@ var mw = ( function ( $, undefined ) {
                                                        raw = localStorage.getItem( mw.loader.store.getStoreKey() );
                                                        // If we get here, localStorage is available; mark enabled.
                                                        mw.loader.store.enabled = true;
-                                                       mw.loader.store.useFunction = !!Math.floor( Math.random() * 2 );
                                                        data = JSON.parse( raw );
                                                        if ( data && typeof data.items === 'object' && data.vary === mw.loader.store.getVary() ) {
                                                                mw.loader.store.items = data.items;