desktop/source/app/initjsunoscripting.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 393fe2d9367d293922c7bc761af893b6ba86aff7
Author:     Stephan Bergmann <stephan.bergm...@collabora.com>
AuthorDate: Tue Jul 29 22:58:59 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@collabora.com>
CommitDate: Wed Jul 30 09:34:17 2025 +0200

    Emscripten: Make sure global Module is available in worker threads
    
    ...also in -sMODULARIZE builds (and as expected to be available by the code 
in
    static/emscripten/uno.js).  (Using a suggestion from the discussion at
    
<https://groups.google.com/g/emscripten-discuss/c/cMTCPit5xig/m/B-rvUHPCAQAJ?utm_medium=email&utm_source=footer&pli=1>
    "Accessing a thread's module instance in an -sMODULARIZE -pthread setting?")
    
    Change-Id: Ice5ed4ed109b4d541e254b49eee9972a212d8b11
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188561
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com>
    (cherry picked from commit 6c5b42f72e9c52077101d492eb7a0c170948bb77)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188573
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/app/initjsunoscripting.cxx 
b/desktop/source/app/initjsunoscripting.cxx
index a7de93f5f4f4..bb2dffa10ecb 100644
--- a/desktop/source/app/initjsunoscripting.cxx
+++ b/desktop/source/app/initjsunoscripting.cxx
@@ -45,6 +45,7 @@ extern "C" void getUnoScriptUrls(std::vector<std::u16string> 
* urls) {
 
 #if HAVE_EMSCRIPTEN_PROXY_TO_PTHREAD
 EM_JS(void, runUnoScriptUrls, (emscripten::EM_VAL handle), {
+    globalThis.Module ||= Module;
     importScripts.apply(self, Emval.toValue(handle));
 });
 #else

Reply via email to