Skip to content

Commit

Permalink
[file_packager] Pass module object to runWithFS (#22086)
Browse files Browse the repository at this point in the history
This makes it robust against #21775 in case we try to re-land it.

callRuntimeCallbacks passes the actual Module, so use it.
  • Loading branch information
past-due authored Jun 11, 2024
1 parent 77f9840 commit 0086fa3
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 0086fa3

Please sign in to comment.