File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -460,24 +460,28 @@ var inlinediff = (function () {
460460 ] ;
461461 }
462462
463+ function hasProp ( obj , x ) {
464+ return Object . prototype . hasOwnProperty . call ( obj , x ) ;
465+ }
466+
463467 function diff ( o , n ) {
464468 var ns = new Object ( ) ;
465469 var os = new Object ( ) ;
466470
467471 for ( var i = 0 ; i < n . length ; i ++ ) {
468- if ( ns [ n [ i ] ] == null )
472+ if ( ! hasProp ( ns , n [ i ] ) )
469473 ns [ n [ i ] ] = { rows : new Array ( ) , o : null } ;
470474 ns [ n [ i ] ] . rows . push ( i ) ;
471475 }
472476
473477 for ( var i = 0 ; i < o . length ; i ++ ) {
474- if ( os [ o [ i ] ] == null )
478+ if ( ! hasProp ( os , o [ i ] ) )
475479 os [ o [ i ] ] = { rows : new Array ( ) , n : null } ;
476480 os [ o [ i ] ] . rows . push ( i ) ;
477481 }
478482
479483 for ( var i in ns ) {
480- if ( ns [ i ] . rows . length == 1 && typeof ( os [ i ] ) != "undefined" && os [ i ] . rows . length == 1 ) {
484+ if ( ns [ i ] . rows . length == 1 && hasProp ( os , i ) && os [ i ] . rows . length == 1 ) {
481485 n [ ns [ i ] . rows [ 0 ] ] = { text : n [ ns [ i ] . rows [ 0 ] ] , row : os [ i ] . rows [ 0 ] } ;
482486 o [ os [ i ] . rows [ 0 ] ] = { text : o [ os [ i ] . rows [ 0 ] ] , row : ns [ i ] . rows [ 0 ] } ;
483487 }
You can’t perform that action at this time.
0 commit comments