[FIX] runbot: export diff_match_patch

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).
This commit is contained in:
William Braeckman 2024-12-11 15:36:36 +01:00 committed by xdo
parent f847ba57e1
commit 33bef243d2
2 changed files with 17 additions and 9 deletions

View File

@ -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() {
@ -76,4 +77,4 @@ patch(Message.prototype, {
}
return lines;
},
});
});

View File

@ -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
};