Skip to content

Commit

Permalink
[FIX] runbot: export diff_match_patch
Browse files Browse the repository at this point in the history
Fixes the export of diff_match_patch, it previously used global export
which is not supported anymore (at least not the way it was doing it
before).
  • Loading branch information
Williambraecky authored and Xavier-Do committed Dec 11, 2024
1 parent f847ba5 commit 33bef24
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
3 changes: 2 additions & 1 deletion runbot/static/src/js/fields/tracking_value.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { Message } from "@mail/core/common/message";
import { diff_match_patch } from "@runbot/libs/diff_match_patch/diff_match_patch";

patch(Message.prototype, {
setup() {
Expand Down Expand Up @@ -76,4 +77,4 @@ patch(Message.prototype, {
}
return lines;
},
});
});
23 changes: 15 additions & 8 deletions runbot/static/src/libs/diff_match_patch/diff_match_patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2226,11 +2226,18 @@ var diff_match_patch = function() {
// In a browser, 'this' will be 'window'.
// Users of node.js should 'require' the uncompressed version since Google's
// JS compiler may break the following exports for non-browser environments.
/** @suppress {globalThis} */
this['diff_match_patch'] = diff_match_patch;
/** @suppress {globalThis} */
this['DIFF_DELETE'] = DIFF_DELETE;
/** @suppress {globalThis} */
this['DIFF_INSERT'] = DIFF_INSERT;
/** @suppress {globalThis} */
this['DIFF_EQUAL'] = DIFF_EQUAL;
// /** @suppress {globalThis} */
// this['diff_match_patch'] = diff_match_patch;
// /** @suppress {globalThis} */
// this['DIFF_DELETE'] = DIFF_DELETE;
// /** @suppress {globalThis} */
// this['DIFF_INSERT'] = DIFF_INSERT;
// /** @suppress {globalThis} */
// this['DIFF_EQUAL'] = DIFF_EQUAL;

export {
diff_match_patch,
DIFF_DELETE,
DIFF_INSERT,
DIFF_EQUAL
};

0 comments on commit 33bef24

Please sign in to comment.