File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 212
212
var diffs = jsonpatch . compare ( leftJson , rightJson ) ;
213
213
console . log ( diffs ) ;
214
214
diffs . forEach ( function ( diff ) {
215
- if ( diff . op === 'remove' ) {
216
- leftInputView . highlightRemoval ( diff ) ;
217
- } else if ( diff . op === 'add' ) {
218
- rightInputView . highlightAddition ( diff ) ;
219
- } else if ( diff . op === 'replace' ) {
220
- rightInputView . highlightChange ( diff ) ;
221
- leftInputView . highlightChange ( diff ) ;
215
+ try {
216
+ if ( diff . op === 'remove' ) {
217
+ leftInputView . highlightRemoval ( diff ) ;
218
+ } else if ( diff . op === 'add' ) {
219
+ rightInputView . highlightAddition ( diff ) ;
220
+ } else if ( diff . op === 'replace' ) {
221
+ rightInputView . highlightChange ( diff ) ;
222
+ leftInputView . highlightChange ( diff ) ;
223
+ }
224
+ } catch ( e ) {
225
+ console . warn ( 'error while trying to highlight diff' , e ) ;
222
226
}
223
227
} ) ;
224
228
}
You can’t perform that action at this time.
0 commit comments