Use [] instead of new Array.
authorDaniel Friesen <dantman@users.mediawiki.org>
Fri, 12 Aug 2011 10:25:16 +0000 (10:25 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Fri, 12 Aug 2011 10:25:16 +0000 (10:25 +0000)
skins/common/protect.js
skins/common/wikibits.js

index b77c2e0..c771d57 100644 (file)
@@ -252,7 +252,7 @@ window.ProtectionForm = {
         */
        'getLevelSelectors': function() {
                var all = document.getElementsByTagName("select");
-               var ours = new Array();
+               var ours = [];
                for (var i = 0; i < all.length; i++) {
                        var element = all[i];
                        if (element.id.match(/^mwProtect-level-/)) {
@@ -281,7 +281,7 @@ window.ProtectionForm = {
         */
        'getExpiryInputs': function() {
                var all = document.getElementsByTagName("input");
-               var ours = new Array();
+               var ours = [];
                for (var i = 0; i < all.length; i++) {
                        var element = all[i];
                        if (element.name.match(/^mwProtect-expiry-/)) {
@@ -309,7 +309,7 @@ window.ProtectionForm = {
         */
        'getExpirySelectors': function() {
                var all = document.getElementsByTagName("select");
-               var ours = new Array();
+               var ours = [];
                for (var i = 0; i < all.length; i++) {
                        var element = all[i];
                        if (element.id.match(/^mwProtectExpirySelection-/)) {
index 5cb037b..682034a 100644 (file)
@@ -319,7 +319,7 @@ window.addPortletLink = function( portlet, href, text, id, tooltip, accesskey, n
                link.setAttribute( 'title', tooltip );
        }
        if ( accesskey && tooltip ) {
-               updateTooltipAccessKeys( new Array( link ) );
+               updateTooltipAccessKeys( [link] );
        }
 
        if ( nextnode && nextnode.parentNode == node ) {
@@ -445,7 +445,7 @@ window.checkboxClickHandler = function( e ) {
        From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
 */
 window.getElementsByClassName = function( oElm, strTagName, oClassNames ) {
-       var arrReturnElements = new Array();
+       var arrReturnElements = [];
        if ( typeof( oElm.getElementsByClassName ) == 'function' ) {
                /* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */
                var arrNativeReturn = oElm.getElementsByClassName( oClassNames );
@@ -460,7 +460,7 @@ window.getElementsByClassName = function( oElm, strTagName, oClassNames ) {
                return arrReturnElements;
        }
        var arrElements = ( strTagName == '*' && oElm.all ) ? oElm.all : oElm.getElementsByTagName( strTagName );
-       var arrRegExpClassNames = new Array();
+       var arrRegExpClassNames = [];
        if( typeof oClassNames == 'object' ) {
                for( var i = 0; i < oClassNames.length; i++ ) {
                        arrRegExpClassNames[arrRegExpClassNames.length] =
@@ -667,4 +667,4 @@ hookEvent( 'load', runOnloadHook );
 
 if ( ie6_bugs ) {
        importScriptURI( stylepath + '/common/IEFixes.js' );
-}
\ No newline at end of file
+}