Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/lib/libfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ FS.staticInit();
#if FS_DEBUG
trackingDelegate: {},
#endif
ErrnoError: null, // set during init
filesystems: null,
syncFSRequests: 0, // we warn if there are multiple in flight at once
#if expectToReceiveOnModule('logReadFiles')
Expand Down
23 changes: 7 additions & 16 deletions src/lib/libwasmfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ addToLibrary({
$wasmFSDevices: {},
$wasmFSDeviceStreams: {},

$FS__postset: `
FS.init();
`,
$FS__deps: [
'$MEMFS',
'$wasmFSPreloadedFiles',
Expand Down Expand Up @@ -74,10 +71,14 @@ FS.init();
#endif
],
$FS : {
init() {
FS.ensureErrnoError();
ErrnoError: class extends Error {
name = 'ErrnoError';
message = 'FS error';
constructor(code) {
super();
this.errno = code
}
},
ErrnoError: null,
handleError(returnValue) {
// Assume errors correspond to negative returnValues
// since some functions like _wasmfs_open() return positive
Expand All @@ -88,16 +89,6 @@ FS.init();

return returnValue;
},
ensureErrnoError() {
if (FS.ErrnoError) return;
FS.ErrnoError = /** @this{Object} */ function ErrnoError(code) {
this.errno = code;
this.message = 'FS error';
this.name = "ErrnoError";
}
FS.ErrnoError.prototype = new Error();
FS.ErrnoError.prototype.constructor = FS.ErrnoError;
},
createDataFile(parent, name, fileData, canRead, canWrite, canOwn) {
FS_createDataFile(parent, name, fileData, canRead, canWrite, canOwn);
},
Expand Down
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9269
9271
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_mangle.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9277
9276