Fix noglobals exceptions from QUnit
authorKrinkle <krinkle@users.mediawiki.org>
Wed, 3 Aug 2011 11:59:11 +0000 (11:59 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Wed, 3 Aug 2011 11:59:11 +0000 (11:59 +0000)
* Test results prior to this commit: http://i.imgur.com/m8rbk.png
* http://localhost/trunkw/tests/qunit/?noglobals=1

- Missing var-statement, causes global scope implication
- Missing semi colon, causing next to be global

resources/jquery/jquery.textSelection.js
resources/mediawiki/mediawiki.Title.js

index b16e755..5b3c833 100644 (file)
@@ -454,7 +454,7 @@ scrollToCaretPosition: function( options ) {
                context.fn.restoreSelection();
                needSave = true;
        }
-       retval = ( hasIframe ? context.fn : fn )[command].call( this, options );
+       var retval = ( hasIframe ? context.fn : fn )[command].call( this, options );
        if ( hasIframe && needSave ) {
                context.fn.saveSelection();
        }
index 96292d2..985c5c9 100644 (file)
@@ -120,7 +120,7 @@ var Title = function( title, namespace ) {
         * @return {mw.Title}
         */
        setAll = function( title, s ) {
-               var     matches = s.match( /^(?:([^:]+):)?(.*?)(?:\.(\w{1,5}))?$/ );
+               var     matches = s.match( /^(?:([^:]+):)?(.*?)(?:\.(\w{1,5}))?$/ ),
                        ns_match = getNsIdByName( matches[1] );
                if ( matches.length && ns_match ) {
                        if ( matches[1] ) { title._ns = ns_match; }