Skip to content

Commit baa99fa

Browse files
committed
Re-add calledMain variable using Module[postRun]
`calledMain` global variable was removed from the JS runtime in emscripten 3.1.17
1 parent a891523 commit baa99fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pre-worker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ function isBrotliFile(url) {
5757
Module = Module || {};
5858

5959
Module["preRun"] = Module["preRun"] || [];
60+
Module["postRun"] = Module["postRun"] || [];
6061

6162
Module["preRun"].push(function () {
6263
Module["FS_createPath"]("/", "fonts", true, true);
@@ -103,6 +104,12 @@ Module["preRun"].push(function () {
103104
}
104105
});
105106

107+
var calledMain = false;
108+
109+
Module["postRun"].push(function () {
110+
calledMain = true;
111+
});
112+
106113
Module['onRuntimeInitialized'] = function () {
107114
self.octObj = new Module.SubtitleOctopus();
108115

0 commit comments

Comments
 (0)