mw.Uri: Use more intuitive variable names
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 14 Jun 2019 18:02:58 +0000 (20:02 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 14 Jun 2019 18:03:21 +0000 (20:03 +0200)
Change-Id: I8e53d7a0e0b89909a5c3798a819a0690c757a060

resources/src/mediawiki.Uri/Uri.js

index c7c061e..4343ecc 100644 (file)
                                q = {};
                                // using replace to iterate over a string
                                if ( uri.query ) {
-                                       uri.query.replace( /(?:^|&)([^&=]*)(?:(=)([^&]*))?/g, function ( $0, $1, $2, $3 ) {
-                                               var k, v;
-                                               if ( $1 ) {
-                                                       k = Uri.decode( $1 );
-                                                       v = ( $2 === '' || $2 === undefined ) ? null : Uri.decode( $3 );
+                                       uri.query.replace( /(?:^|&)([^&=]*)(?:(=)([^&]*))?/g, function ( match, k, eq, v ) {
+                                               if ( k ) {
+                                                       k = Uri.decode( k );
+                                                       v = ( eq === '' || eq === undefined ) ? null : Uri.decode( v );
 
                                                        // If overrideKeys, always (re)set top level value.
                                                        // If not overrideKeys but this key wasn't set before, then we set it as well.