Skip to content

Commit 3ff68ca

Browse files
authored
Fix FS forceLoadFile() function (#25004)
Fixes `strict_js.test_files` and other `strict_js` suite runs.
1 parent 0cd10fd commit 3ff68ca

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/lib/libfs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,8 +1710,10 @@ FS.staticInit();`;
17101710
} else { // Command-line.
17111711
try {
17121712
obj.contents = readBinary(obj.url);
1713-
obj.usedBytes = obj.contents.length;
17141713
} catch (e) {
1714+
#if FS_DEBUG
1715+
dbg(`forceLoadFile exception: ${e}`);
1716+
#endif
17151717
throw new FS.ErrnoError({{{ cDefs.EIO }}});
17161718
}
17171719
}

test/code_size/test_codesize_file_preload.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 22699,
3-
"a.out.js.gz": 9379,
2+
"a.out.js": 22684,
3+
"a.out.js.gz": 9375,
44
"a.out.nodebug.wasm": 1733,
55
"a.out.nodebug.wasm.gz": 980,
6-
"total": 24432,
7-
"total_gz": 10359,
6+
"total": 24417,
7+
"total_gz": 10355,
88
"sent": [
99
"a (fd_write)"
1010
],

test/other/codesize/test_codesize_file_preload.expected.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2804,7 +2804,6 @@ var FS = {
28042804
// Command-line.
28052805
try {
28062806
obj.contents = readBinary(obj.url);
2807-
obj.usedBytes = obj.contents.length;
28082807
} catch (e) {
28092808
throw new FS.ErrnoError(29);
28102809
}

0 commit comments

Comments
 (0)