@@ -2410,10 +2410,24 @@ diff_match_patch.patch_obj.prototype.toString = function() {
24102410 return text . join ( '' ) . replace ( / % 2 0 / g, ' ' ) ;
24112411} ;
24122412
2413-
2414- // The following export code was added by @ForbesLindesay
2415- module . exports = diff_match_patch ;
2416- module . exports [ 'diff_match_patch' ] = diff_match_patch ;
2417- module . exports [ 'DIFF_DELETE' ] = DIFF_DELETE ;
2418- module . exports [ 'DIFF_INSERT' ] = DIFF_INSERT ;
2419- module . exports [ 'DIFF_EQUAL' ] = DIFF_EQUAL ;
2413+ // CLOSURE:begin_strip
2414+ // Lines below here will not be included in the Closure-compatible library.
2415+ if ( typeof module === 'object' ) {
2416+ // The following export code was added by @ForbesLindesay
2417+ module . exports = diff_match_patch ;
2418+ module . exports [ 'diff_match_patch' ] = diff_match_patch ;
2419+ module . exports [ 'DIFF_DELETE' ] = DIFF_DELETE ;
2420+ module . exports [ 'DIFF_INSERT' ] = DIFF_INSERT ;
2421+ module . exports [ 'DIFF_EQUAL' ] = DIFF_EQUAL ;
2422+ } else {
2423+ // Export these global variables so that they survive Google's JS compiler.
2424+ // In a browser, 'this' will be 'window'.
2425+ /** @suppress {globalThis} */
2426+ this [ 'diff_match_patch' ] = diff_match_patch ;
2427+ /** @suppress {globalThis} */
2428+ this [ 'DIFF_DELETE' ] = DIFF_DELETE ;
2429+ /** @suppress {globalThis} */
2430+ this [ 'DIFF_INSERT' ] = DIFF_INSERT ;
2431+ /** @suppress {globalThis} */
2432+ this [ 'DIFF_EQUAL' ] = DIFF_EQUAL ;
2433+ }
0 commit comments