I checked the `-O0` without getting assertions/warnings. [email protected] schrieb am Montag, 16. Juni 2025 um 20:56:42 UTC+2:
> On Sun, Jun 15, 2025 at 12:52 PM Thomas Grund <[email protected]> > wrote: > >> I compiled with `emcc -g ...` and did not get any message in the browser >> console. >> > > Did you also compile with `-O0` ? Or rather, without `-O1` or above? > > >> [email protected] schrieb am Freitag, 13. Juni 2025 um 20:16:55 UTC+2: >> >>> On Fri, Jun 13, 2025 at 2:05 AM Thomas Grund <[email protected]> >>> wrote: >>> >>>> Ah ok, it is working now by changing order and putting `var Module={};` >>>> in front of `Module.onRuntimeInitialized=function() {...`. >>>> >>> >>> Great! >>> >>> You could also do `var Module = { onRuntimeInitialized = () => ... }` . >>> >>> BTW, did you try a debug build? Can you confirm if you saw the >>> assertion/warning about assigning to onRuntimeInitialized too late? >>> >>> Thanks for explaining! >>>> >>>> Thomas >>>> >>>> [email protected] schrieb am Freitag, 13. Juni 2025 um 00:48:33 UTC+2: >>>> >>>>> If you want to be sure that `onRuntimeInitialized` is called you need >>>>> to set it on the `Module` object before you import the generated code. >>>>> Otherwise the runtime could get initialized before you set >>>>> `Module.onRuntimeInitialized`. >>>>> >>>>> In debug builds you should see a warning when these things happen in >>>>> the wrong order. See `consumedModuleProp('onRuntimeInitialized');` for >>>>> how >>>>> this is supposed to work. >>>>> >>>>> cheers, >>>>> sam >>>>> >>>>> On Thu, Jun 12, 2025 at 3:11 PM Thomas Grund <[email protected]> >>>>> wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> (I want to pass large strings (around 100 MB) from JavaScript to C++ >>>>>> in the first place. >>>>>> This is a really reduced Code to show the problem, even if the code >>>>>> makes no sense anymore.) >>>>>> The Code IsNotWorking.html is working in Firefox but not in Chrome. >>>>>> Working means, that I can see the two console outputs: >>>>>> >>>>>> within onRuntimeInitialized >>>>>> within loadString >>>>>> >>>>>> >>>>>> The Code IsWorking.html is working in Firefox and in Chrome. >>>>>> The difference is just two lines which are not needed at all. >>>>>> Even by just commenting out these two lines, it does not work in >>>>>> Chrome. >>>>>> I put the code on Github, since there are large strings involved: >>>>>> >>>>>> https://github.com/ctgrund/Emscripten >>>>>> >>>>>> Windows 11, emcc 4.0.3, Firefox 139.0.4 64 Bit, Chrome 137.0.7151.104 >>>>>> 64 Bit >>>>>> Can somebody reproduce this? >>>>>> >>>>>> Thanks for Your help!! >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "emscripten-discuss" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to [email protected]. >>>>>> To view this discussion visit >>>>>> https://groups.google.com/d/msgid/emscripten-discuss/fe17b884-8722-4e70-a7c5-6a1b655bb088n%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/emscripten-discuss/fe17b884-8722-4e70-a7c5-6a1b655bb088n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>> . >>>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "emscripten-discuss" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> >>> To view this discussion visit >>>> https://groups.google.com/d/msgid/emscripten-discuss/04e61db0-403d-4ab0-a4b3-2b070c2b0eafn%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/emscripten-discuss/04e61db0-403d-4ab0-a4b3-2b070c2b0eafn%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> > To view this discussion visit >> https://groups.google.com/d/msgid/emscripten-discuss/7b89e309-819b-428f-bc1f-a5a92cf76f8an%40googlegroups.com >> >> <https://groups.google.com/d/msgid/emscripten-discuss/7b89e309-819b-428f-bc1f-a5a92cf76f8an%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/emscripten-discuss/f5c89862-27c7-402a-a440-ba6178fa54cbn%40googlegroups.com.
