Skip to content

Commit

Permalink
Re-add calledMain variable using Module[postRun]
Browse files Browse the repository at this point in the history
`calledMain` global variable was removed from the JS runtime
in emscripten 3.1.17
  • Loading branch information
dmitrylyzo committed Jul 23, 2024
1 parent a891523 commit baa99fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pre-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function isBrotliFile(url) {
Module = Module || {};

Module["preRun"] = Module["preRun"] || [];
Module["postRun"] = Module["postRun"] || [];

Module["preRun"].push(function () {
Module["FS_createPath"]("/", "fonts", true, true);
Expand Down Expand Up @@ -103,6 +104,12 @@ Module["preRun"].push(function () {
}
});

var calledMain = false;

Module["postRun"].push(function () {
calledMain = true;
});

Module['onRuntimeInitialized'] = function () {
self.octObj = new Module.SubtitleOctopus();

Expand Down

0 comments on commit baa99fa

Please sign in to comment.