Skip to content

Commit da3a1b6

Browse files
authored
Simplify filesystem method export. NFC (#22331)
1 parent 58359ba commit da3a1b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/library_fs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ FS.ignorePermissions = false;
4141
addAtExit('FS.quit();');
4242
return `
4343
FS.createPreloadedFile = FS_createPreloadedFile;
44-
FS.staticInit();` +
45-
// Get module methods from settings
46-
'{{{ EXPORTED_RUNTIME_METHODS.filter(function(func) { return func.substr(0, 3) === 'FS_' }).map(function(func){return 'Module["' + func + '"] = FS.' + func.substr(3) + ";"}).reduce(function(str, func){return str + func;}, '') }}}';
44+
FS.staticInit();
45+
// Set module methods based on EXPORTED_RUNTIME_METHODS
46+
{{{ EXPORTED_RUNTIME_METHODS.filter((func) => func.startsWith('FS_')).map((func) => 'Module["' + func + '"] = FS.' + func.substr(3) + ";\n").reduce((str, func) => str + func, '') }}}`;
4747
},
4848
$FS: {
4949
root: null,

0 commit comments

Comments
 (0)