Skip to content

Commit

Permalink
file_packager.py: Fix runWithFS() since PR emscripten-core#21775
Browse files Browse the repository at this point in the history
callRuntimeCallbacks passes the actual Module, so use it
  • Loading branch information
past-due committed Jun 11, 2024
1 parent 59d2290 commit 9af3328
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/file_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,12 +1094,12 @@ def generate_js(data_target, data_files, metadata):
}\n'''

ret += '''
function runWithFS() {\n'''
function runWithFS(Module) {\n'''
ret += code
ret += '''
}
if (Module['calledRun']) {
runWithFS();
runWithFS(Module);
} else {
if (!Module['preRun']) Module['preRun'] = [];
Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it
Expand Down

0 comments on commit 9af3328

Please sign in to comment.