jenkins-bot has submitted this change and it was merged.

Change subject: qunit.completenessTest: Correct walkTheObject behaviour wrt 
breadcrumb
......................................................................


qunit.completenessTest: Correct walkTheObject behaviour wrt breadcrumb

The function documentation states that currName is not included in
parentPathArray, although it actually is. This change makes the
implementation match the documentated behavior.

Change-Id: I6e44ad84de2e31320309438b8aa09ec929d15e8e
---
M resources/src/jquery/jquery.qunit.completenessTest.js
1 file changed, 13 insertions(+), 48 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/resources/src/jquery/jquery.qunit.completenessTest.js 
b/resources/src/jquery/jquery.qunit.completenessTest.js
index 1c47feb..d6dfedd 100644
--- a/resources/src/jquery/jquery.qunit.completenessTest.js
+++ b/resources/src/jquery/jquery.qunit.completenessTest.js
@@ -34,36 +34,6 @@
                        }
                        return keys;
                },
-               extend: function () {
-                       var options, name, src, copy,
-                               target = arguments[0] || {},
-                               i = 1,
-                               length = arguments.length;
-
-                       for ( ; i < length; i++ ) {
-                               options = arguments[ i ];
-                               // Only deal with non-null/undefined values
-                               if ( options !== null && options !== undefined 
) {
-                                       // Extend the base object
-                                       for ( name in options ) {
-                                               src = target[ name ];
-                                               copy = options[ name ];
-
-                                               // Prevent never-ending loop
-                                               if ( target === copy ) {
-                                                       continue;
-                                               }
-
-                                               if ( copy !== undefined ) {
-                                                       target[ name ] = copy;
-                                               }
-                                       }
-                               }
-                       }
-
-                       // Return the modified object
-                       return target;
-               },
                each: function ( object, callback ) {
                        var name;
                        for ( name in object ) {
@@ -222,20 +192,24 @@
                 * @param action {Number} What is this function supposed to do 
(ACTION_INJECT or ACTION_CHECK)
                 */
                walkTheObject: function ( currName, currVar, masterVariable, 
parentPathArray, action ) {
-
-                       var key, value, tmpPathArray,
+                       var key, value, currPathArray,
                                type = util.type( currVar ),
                                that = this;
 
+                       currPathArray = parentPathArray;
+                       if ( currName ) {
+                               currPathArray.push( currName );
+                       }
+
                        // Hard ignores
-                       if ( this.ignoreFn( currVar, that, parentPathArray ) ) {
+                       if ( this.ignoreFn( currVar, that, currPathArray ) ) {
                                return null;
                        }
 
                        // Handle the lazy limit
                        this.lazyCounter++;
                        if ( this.lazyCounter > this.lazyLimit ) {
-                               log( 'CompletenessTest.fn.walkTheObject> Limit 
reached: ' + this.lazyCounter, parentPathArray );
+                               log( 'CompletenessTest.fn.walkTheObject> Limit 
reached: ' + this.lazyCounter, currPathArray );
                                return null;
                        }
 
@@ -246,9 +220,9 @@
 
                                        if ( action === 
CompletenessTest.ACTION_INJECT ) {
 
-                                               that.injectionTracker[ 
parentPathArray.join( '.' ) ] = true;
-                                               that.injectCheck( 
masterVariable, parentPathArray, function () {
-                                                       that.methodCallTracker[ 
parentPathArray.join( '.' ) ] = true;
+                                               that.injectionTracker[ 
currPathArray.join( '.' ) ] = true;
+                                               that.injectCheck( 
masterVariable, currPathArray, function () {
+                                                       that.methodCallTracker[ 
currPathArray.join( '.' ) ] = true;
                                                } );
                                        }
 
@@ -264,12 +238,7 @@
                                                                        
continue;
                                                                }
 
-                                                               // Clone and 
break reference to parentPathArray
-                                                               tmpPathArray = 
util.extend( [], parentPathArray );
-                                                               
tmpPathArray.push( 'prototype' );
-                                                               
tmpPathArray.push( key );
-
-                                                               
that.walkTheObject( key, value, masterVariable, tmpPathArray, action );
+                                                               
that.walkTheObject( key, value, masterVariable, currPathArray.concat( 
'prototype' ), action );
                                                        }
                                                }
 
@@ -284,11 +253,7 @@
                                        if ( hasOwn.call( currVar, key ) ) {
                                                value = currVar[key];
 
-                                               // Clone and break reference to 
parentPathArray
-                                               tmpPathArray = util.extend( [], 
parentPathArray );
-                                               tmpPathArray.push( key );
-
-                                               that.walkTheObject( key, value, 
masterVariable, tmpPathArray, action );
+                                               that.walkTheObject( key, value, 
masterVariable, currPathArray.slice(), action );
                                        }
                                }
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/121604
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6e44ad84de2e31320309438b8aa09ec929d15e8e
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Adrian Lang <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Adrian Lang <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to