Use native ES5 Array prototype methods instead of jQuery
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.Uri.js
index 95263ec..450b415 100644 (file)
                                                // Only copy direct properties, not inherited ones
                                                if ( uri.hasOwnProperty( prop ) ) {
                                                        // Deep copy object properties
-                                                       if ( $.isArray( uri[ prop ] ) || $.isPlainObject( uri[ prop ] ) ) {
+                                                       if ( Array.isArray( uri[ prop ] ) || $.isPlainObject( uri[ prop ] ) ) {
                                                                this[ prop ] = $.extend( true, {}, uri[ prop ] );
                                                        } else {
                                                                this[ prop ] = uri[ prop ];
 
                                // Apply parser regex and set all properties based on the result
                                matches = parser[ options.strictMode ? 'strict' : 'loose' ].exec( str );
-                               $.each( properties, function ( i, property ) {
+                               properties.forEach( function ( property, i ) {
                                        uri[ property ] = matches[ i + 1 ];
                                } );
 
                                                                        q[ k ] = [ q[ k ] ];
                                                                }
                                                                // Add to the array
-                                                               if ( $.isArray( q[ k ] ) ) {
+                                                               if ( Array.isArray( q[ k ] ) ) {
                                                                        q[ k ].push( v );
                                                                }
                                                        }
                                var args = [];
                                $.each( this.query, function ( key, val ) {
                                        var k = Uri.encode( key ),
-                                               vals = $.isArray( val ) ? val : [ val ];
-                                       $.each( vals, function ( i, v ) {
+                                               vals = Array.isArray( val ) ? val : [ val ];
+                                       vals.forEach( function ( v ) {
                                                if ( v === null ) {
                                                        args.push( k );
                                                } else if ( k === 'title' ) {