r105447 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105446‎ | r105447 | r105448 >
Date:18:29, 7 December 2011
Author:tparscal
Status:deferred
Tags:
Comment:
JSHint fixes
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/es.TransactionProcessor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/es.TransactionProcessor.js
@@ -307,8 +307,14 @@
308308 var ranges = this.model.selectNodes( new es.Range( this.cursor, this.cursor + op.data.length ) );
309309
310310 // Build the list of nodes to rebuild and the data to keep
311 - var oldNodes = [], newData = [], parent = null, index = null, firstKeptNode, lastKeptNode;
312 - for ( var i = 0; i < ranges.length; i++ ) {
 311+ var oldNodes = [],
 312+ newData = [],
 313+ parent = null,
 314+ index = null,
 315+ firstKeptNode,
 316+ lastKeptNode,
 317+ i;
 318+ for ( i = 0; i < ranges.length; i++ ) {
313319 oldNodes.push( ranges[i].node );
314320 if ( ranges[i].range !== undefined ) {
315321 // We have to keep part of this node
@@ -349,9 +355,11 @@
350356 // node we visit and verify that the transaction is a valid merge (i.e. it satisfies
351357 // the merge criteria in prepareRemoval()'s canMerge()).
352358 // FIXME: The code is essentially the same as canMerge(), merge these algorithms
353 - var openings = [], closings = [],
 359+ var openings = [],
 360+ closings = [],
354361 paths = es.DocumentNode.getCommonAncestorPaths( firstKeptNode, lastKeptNode ),
355 - i, prevN1, prevN2;
 362+ prevN1,
 363+ prevN2;
356364
357365 if ( !paths ) {
358366 throw 'Removal is not a valid merge: nodes do not have a common ancestor or are not at the same depth';

Status & tagging log