Skip to content

Commit 3abc653

Browse files
authored
WasmFS: Include all WasmFS JS code when INCLUDE_FULL_LIBRARY (#19555)
The issue is that only FORCE_FILESYSTEM causes the full JS API code to be present, but other places refer to FS.cwd() (PATH_FS). What we kind of want is for PATH_FS to cause FORCE_FILESYSTEM to be set, but it's too late for that in the compilation process.
1 parent bf25d34 commit 3abc653

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/library_wasmfs.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FS.createPreloadedFile = FS_createPreloadedFile;
2323
'$FS_getMode',
2424
// For FS.readFile
2525
'$UTF8ArrayToString',
26-
#if FORCE_FILESYSTEM
26+
#if FORCE_FILESYSTEM || INCLUDE_FULL_LIBRARY // see comment below on FORCE
2727
'$FS_modeStringToFlags',
2828
'malloc',
2929
'free',
@@ -94,7 +94,13 @@ FS.createPreloadedFile = FS_createPreloadedFile;
9494
return ret;
9595
},
9696

97-
#if FORCE_FILESYSTEM
97+
#if FORCE_FILESYSTEM || INCLUDE_FULL_LIBRARY // FORCE_FILESYSTEM makes us
98+
// include all JS library code. We
99+
// must also do so if
100+
// INCLUDE_FULL_LIBRARY as other
101+
// places will refer to FS.cwd()
102+
// in that mode, and so we need
103+
// to include that.
98104
// Full JS API support
99105

100106
cwd: () => {

0 commit comments

Comments
 (0)