r105240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105239‎ | r105240 | r105241 >
Date:22:55, 5 December 2011
Author:tparscal
Status:deferred
Tags:
Comment:
inArray returns an index, -1 is failure not 0 or a falsey value
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js
@@ -898,12 +898,12 @@
899899 } else if ( !leftPlain && !rightPlain ) {
900900 // [formatted][formatted] pair, open/close any differences
901901 for ( j = 1; j < left.length; j++ ) {
902 - if ( es.inArray( left[j], right ) ) {
 902+ if ( es.inArray( left[j], right ) === -1 ) {
903903 out += render( 'close', left[j], stack );
904904 }
905905 }
906906 for ( j = 1; j < right.length; j++ ) {
907 - if ( es.inArray( right[j], left ) ) {
 907+ if ( es.inArray( right[j], left ) === -1 ) {
908908 out += render( 'open', right[j], stack );
909909 }
910910 }

Status & tagging log