From 26d3f9264501a3e5cf0928f1e24368cf3f419be3 Mon Sep 17 00:00:00 2001 From: stephenduong1004 Date: Mon, 6 Apr 2026 13:19:14 -0400 Subject: [PATCH 1/6] Fix multiple jscompiler errors --- src/lib/libembind.js | 4 ++-- src/lib/libwasi.js | 1 - src/preamble.js | 11 ++++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/libembind.js b/src/lib/libembind.js index defd2498dcff9..19080626392f3 100644 --- a/src/lib/libembind.js +++ b/src/lib/libembind.js @@ -375,7 +375,7 @@ var LibraryEmbind = { } #if ASSERTIONS else if (typeof value != "bigint") { - throw new TypeError(`Cannot convert "${embindRepr(value)}" to ${this.name}`); + throw new TypeError(`Cannot convert "${embindRepr(value)}" to ${name}`); } assertIntegerRange(name, value, minRange, maxRange); #endif @@ -404,7 +404,7 @@ var LibraryEmbind = { toWireType: (destructors, value) => { #if ASSERTIONS if (typeof value != "number" && typeof value != "boolean") { - throw new TypeError(`Cannot convert ${embindRepr(value)} to ${this.name}`); + throw new TypeError(`Cannot convert ${embindRepr(value)} to ${name}`); } #endif // The VM will perform JS to Wasm value conversion, according to the spec: diff --git a/src/lib/libwasi.js b/src/lib/libwasi.js index e83ba664d6b4b..ca3a218553d99 100644 --- a/src/lib/libwasi.js +++ b/src/lib/libwasi.js @@ -17,7 +17,6 @@ var WasiLibrary = { #endif proc_exit__nothrow: true, - proc_exit__docs: '/** @noreturn */', proc_exit: (code) => { #if MINIMAL_RUNTIME throw `exit(${code})`; diff --git a/src/preamble.js b/src/preamble.js index ab3a7d78b8806..7cfc943c3faf7 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -237,7 +237,7 @@ function postRun() { /** * @param {string|number=} what - * @noreturn + * @return {void} */ function abort(what) { #if expectToReceiveOnModule('onAbort') @@ -302,17 +302,18 @@ function abort(what) { #if ASSERTIONS && !('$FS' in addedLibraryItems) // show errors on likely calls to FS when it was not included var FS = { + /** @return {*} */ error() { abort('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM'); }, init() { FS.error() }, createDataFile() { FS.error() }, createPreloadedFile() { FS.error() }, - createLazyFile() { FS.error() }, - open() { FS.error() }, - mkdev() { FS.error() }, + createLazyFile() { return (/** @type {?} */ (FS.error())); }, + open() { return (/** @type {?} */ (FS.error())); }, + mkdev() { return (/** @type {?} */ (FS.error())); }, registerDevice() { FS.error() }, - analyzePath() { FS.error() }, + analyzePath() { return (/** @type {?} */ (FS.error())); }, ErrnoError() { FS.error() }, }; From 083654b53c7ecdcaaa2b9043064e0d2dfcf05316 Mon Sep 17 00:00:00 2001 From: stephenduong1004 Date: Mon, 6 Apr 2026 14:16:30 -0400 Subject: [PATCH 2/6] Delete return {void} doc --- src/preamble.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/preamble.js b/src/preamble.js index 7cfc943c3faf7..ce7509e3ee34c 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -237,7 +237,6 @@ function postRun() { /** * @param {string|number=} what - * @return {void} */ function abort(what) { #if expectToReceiveOnModule('onAbort') From a8e48ee0c4d408a03a15fe829f46a963bba8e613 Mon Sep 17 00:00:00 2001 From: stephenduong1004 Date: Tue, 7 Apr 2026 15:48:01 -0400 Subject: [PATCH 3/6] revert changes to preamble.js Will be fixed in https://github.com/emscripten-core/emscripten/pull/26641 --- src/preamble.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/preamble.js b/src/preamble.js index ce7509e3ee34c..862a6429597b5 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -301,18 +301,17 @@ function abort(what) { #if ASSERTIONS && !('$FS' in addedLibraryItems) // show errors on likely calls to FS when it was not included var FS = { - /** @return {*} */ error() { abort('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM'); }, init() { FS.error() }, createDataFile() { FS.error() }, createPreloadedFile() { FS.error() }, - createLazyFile() { return (/** @type {?} */ (FS.error())); }, - open() { return (/** @type {?} */ (FS.error())); }, - mkdev() { return (/** @type {?} */ (FS.error())); }, + createLazyFile() { FS.error() }, + open() { FS.error() }, + mkdev() { FS.error() }, registerDevice() { FS.error() }, - analyzePath() { return (/** @type {?} */ (FS.error())); }, + analyzePath() { FS.error() }, ErrnoError() { FS.error() }, }; From 8ad6aca4e32e164d85773124acd141dd8cb126d9 Mon Sep 17 00:00:00 2001 From: stephenduong1004 Date: Thu, 9 Apr 2026 14:31:02 -0400 Subject: [PATCH 4/6] Update test_codesize_file_preload.expected.js --- test/codesize/test_codesize_file_preload.expected.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/codesize/test_codesize_file_preload.expected.js b/test/codesize/test_codesize_file_preload.expected.js index 785751e68113b..1ab70743544e1 100644 --- a/test/codesize/test_codesize_file_preload.expected.js +++ b/test/codesize/test_codesize_file_preload.expected.js @@ -363,7 +363,6 @@ function postRun() {} /** * @param {string|number=} what - * @noreturn */ function abort(what) { what = `Aborted(${what})`; // TODO(sbc): Should we remove printing and leave it up to whoever @@ -3082,7 +3081,7 @@ function _fd_write(fd, iov, iovcnt, pnum) { var keepRuntimeAlive = () => true; -/** @noreturn */ var _proc_exit = code => { +var _proc_exit = code => { EXITSTATUS = code; if (!keepRuntimeAlive()) { ABORT = true; From 093262ea27a299a92861591bc6b2472c75bb8f64 Mon Sep 17 00:00:00 2001 From: stephenduong1004 Date: Thu, 9 Apr 2026 14:32:38 -0400 Subject: [PATCH 5/6] Update test_codesize_minimal_O0.expected.js --- test/codesize/test_codesize_minimal_O0.expected.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/codesize/test_codesize_minimal_O0.expected.js b/test/codesize/test_codesize_minimal_O0.expected.js index 5e1a96d0fa02f..90ccede8fa797 100644 --- a/test/codesize/test_codesize_minimal_O0.expected.js +++ b/test/codesize/test_codesize_minimal_O0.expected.js @@ -510,7 +510,6 @@ function postRun() { /** * @param {string|number=} what - * @noreturn */ function abort(what) { From eb1a0e5bb213be81cafa4468217cef861ff27476 Mon Sep 17 00:00:00 2001 From: stephenduong1004 Date: Thu, 9 Apr 2026 14:35:00 -0400 Subject: [PATCH 6/6] Update test_unoptimized_code_size.json --- test/codesize/test_unoptimized_code_size.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/codesize/test_unoptimized_code_size.json b/test/codesize/test_unoptimized_code_size.json index e65e5f2049dff..f9e256d7fbca2 100644 --- a/test/codesize/test_unoptimized_code_size.json +++ b/test/codesize/test_unoptimized_code_size.json @@ -1,16 +1,16 @@ { - "hello_world.js": 57030, - "hello_world.js.gz": 17755, + "hello_world.js": 56998, + "hello_world.js.gz": 17743, "hello_world.wasm": 14850, "hello_world.wasm.gz": 7311, - "no_asserts.js": 26654, - "no_asserts.js.gz": 8901, + "no_asserts.js": 26622, + "no_asserts.js.gz": 8888, "no_asserts.wasm": 12010, "no_asserts.wasm.gz": 5880, - "strict.js": 54848, - "strict.js.gz": 17063, + "strict.js": 54816, + "strict.js.gz": 17052, "strict.wasm": 14850, "strict.wasm.gz": 7311, - "total": 180242, - "total_gz": 64221 + "total": 180146, + "total_gz": 64185 }