Skip to content

Commit

Permalink
Remove return type from FS.createDataFile (emscripten-core#20596)
Browse files Browse the repository at this point in the history
The wasmfs version of this function doesn't (and cannot AFAICT) return
a value, so to make them consistent we simply remove the return type.

This also happens to fix and internal google issue we had regarding
the type of this function and closure compiler.
  • Loading branch information
sbc100 authored Nov 2, 2023
1 parent af231d4 commit f292949
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/library_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,6 @@ FS.staticInit();` +
FS.close(stream);
FS.chmod(node, mode);
}
return node;
},
createDevice(parent, name, input, output) {
var path = PATH.join2(typeof parent == 'string' ? parent : FS.getPath(parent), name);
Expand Down Expand Up @@ -1872,7 +1871,7 @@ FS.staticInit();` +

$FS_createDataFile__deps: ['$FS'],
$FS_createDataFile: (parent, name, fileData, canRead, canWrite, canOwn) => {
return FS.createDataFile(parent, name, fileData, canRead, canWrite, canOwn);
FS.createDataFile(parent, name, fileData, canRead, canWrite, canOwn);
},

$FS_unlink__deps: ['$FS'],
Expand Down
2 changes: 1 addition & 1 deletion src/library_wasmfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ FS.init();
FS.ErrnoError.prototype.constructor = FS.ErrnoError;
},
createDataFile(parent, name, fileData, canRead, canWrite, canOwn) {
return FS_createDataFile(parent, name, fileData, canRead, canWrite, canOwn);
FS_createDataFile(parent, name, fileData, canRead, canWrite, canOwn);
},
createPath(parent, path, canRead, canWrite) {
// Cache file path directory names.
Expand Down

0 comments on commit f292949

Please sign in to comment.