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 @@ -465,24 +465,28 @@ var inlinediff = (function () {
465465 ] ;
466466 }
467467
468+ function hasProp ( obj , x ) {
469+ return Object . prototype . hasOwnProperty . call ( obj , x ) ;
470+ }
471+
468472 function diff ( o , n ) {
469473 var ns = new Object ( ) ;
470474 var os = new Object ( ) ;
471475
472476 for ( var i = 0 ; i < n . length ; i ++ ) {
473- if ( ns [ n [ i ] ] == null )
477+ if ( ! hasProp ( ns , n [ i ] ) )
474478 ns [ n [ i ] ] = { rows : new Array ( ) , o : null } ;
475479 ns [ n [ i ] ] . rows . push ( i ) ;
476480 }
477481
478482 for ( var i = 0 ; i < o . length ; i ++ ) {
479- if ( os [ o [ i ] ] == null )
483+ if ( ! hasProp ( os , o [ i ] ) )
480484 os [ o [ i ] ] = { rows : new Array ( ) , n : null } ;
481485 os [ o [ i ] ] . rows . push ( i ) ;
482486 }
483487
484488 for ( var i in ns ) {
485- if ( ns [ i ] . rows . length == 1 && typeof ( os [ i ] ) != "undefined" && os [ i ] . rows . length == 1 ) {
489+ if ( ns [ i ] . rows . length == 1 && hasProp ( os , i ) && os [ i ] . rows . length == 1 ) {
486490 n [ ns [ i ] . rows [ 0 ] ] = { text : n [ ns [ i ] . rows [ 0 ] ] , row : os [ i ] . rows [ 0 ] } ;
487491 o [ os [ i ] . rows [ 0 ] ] = { text : o [ os [ i ] . rows [ 0 ] ] , row : ns [ i ] . rows [ 0 ] } ;
488492 }
You can’t perform that action at this time.
0 commit comments