mediawiki.user: Simplify getRegistration() code branches
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Feb 2015 06:21:33 +0000 (06:21 +0000)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 10 Feb 2015 15:50:38 +0000 (15:50 +0000)
Change-Id: Iec3663dca276f16e107192a75193b91da230b502

resources/src/mediawiki/mediawiki.user.js

index 809a65e..5e0cfcc 100644 (file)
                        var registration = mw.config.get( 'wgUserRegistration' );
                        if ( user.isAnon() ) {
                                return false;
-                       } else if ( registration === null ) {
+                       }
+                       if ( registration === null ) {
                                // Information may not be available if they signed up before
                                // MW began storing this.
                                return null;
-                       } else {
-                               return new Date( registration );
                        }
+                       return new Date( registration );
                },
 
                /**