Skip to content

Fix the status message for counted main loop blockers - #28177

Merged
sbc100 merged 3 commits into
emscripten-core:mainfrom
Thanatos9404:main-loop-status-count
Nov 5, 2026
Merged

sbc100 merged 3 commits into
emscripten-core:mainfrom
Thanatos9404:main-loop-status-count

Conversation

@Thanatos9404

Copy link
Copy Markdown
Contributor

MainLoop.updateStatus() passed a template literal without its $ signs to Module.setStatus, so while counted main loop blockers ran, a page saw the text {message} ({expected - remaining}/{expected}) instead of, for example, Please wait... (1/2).

The new other.test_emscripten_main_loop_blocker_status runs two counted blockers with a setStatus that prints each status. It fails without the fix.

Fixes #26076

MainLoop.updateStatus() passed a template literal without its `$` signs
to Module.setStatus, so a page saw the text
`{message} ({expected - remaining}/{expected})` instead of, for example,
`Please wait... (1/2)`.

Fixes emscripten-core#26076

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a bug in src/lib/libeventloop.js where string interpolation syntax was incorrect, preventing the status message from correctly displaying the progress of main loop blockers. It also adds a new test test_emscripten_main_loop_blocker_status in test/test_other.py to verify that the blocker status is correctly formatted and displayed. There are no review comments, so I have no feedback to provide.

@sbc100
sbc100 enabled auto-merge (squash) November 5, 2026 16:22
The status message template now interpolates its values, so the
minified JS in test_codesize_hello_dylink_all is 27 bytes smaller.
auto-merge was automatically disabled November 5, 2026 16:50

Head branch was pushed to by a user without write access

@Thanatos9404

Copy link
Copy Markdown
Contributor Author

Merged main and updated test_codesize_hello_dylink_all.json: with the template literal fixed, the minified JS is 27 bytes smaller, which is what the Codesize Checks job flagged.

@sbc100
sbc100 enabled auto-merge (squash) November 5, 2026 16:51
@sbc100
sbc100 merged commit 5ad04cb into emscripten-core:main Nov 5, 2026
43 checks passed
sbc100 pushed a commit that referenced this pull request Nov 9, 2026
…28207)

For a name that is not exported, `emscripten_get_exported_function`:

- with `ASSERTIONS`, printed `No exported function found by name
"{exportedFunc}"`: the template literal had no `$`, and `exportedFunc`
is always undefined at that point. It now prints the name that was
looked up.
- on wasm64, threw `Cannot convert undefined to a BigInt`: the function
fell off the end and returned `undefined`, which the pointer return
wrapper passes to `BigInt`. It now returns 0.

`core/test_get_exported_function.cpp` now also looks up a missing name
and expects NULL, and the test checks the message in unoptimized modes
(where `ASSERTIONS` is on by default). Without the fix it fails in core0
(message) and in wasm64 and wasm64_O2 (TypeError).

Follow-up to #28177.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MainLoop object updateStatus() method error

2 participants