Repository navigation
Refine Atomics.waitAsync polyfill conditions in libatomic.js - #28172
Merged
Merged
Conversation
Only include the `Atomics.waitAsync` polyfill when targeting engines that lack support (Chrome < 91, Safari < 16.4, or Firefox < 145; Node.js has supported `Atomics.waitAsync` since v16.0.0). Also guard the runtime Chrome < 91 user-agent regex check with `#if MIN_CHROME_VERSION < 91` so it is omitted when targeting Chrome 91 or newer (such as the new default `MIN_CHROME_VERSION=93` in emscripten-core#28141).
There was a problem hiding this comment.
Code Review
This pull request updates the polyfill logic for Atomics.waitAsync in src/lib/libatomic.js to better reflect browser support versions. The review identified an inaccuracy regarding the Firefox version, noting that support was added in version 87 rather than 145, and provided a code suggestion to correct the version check to avoid unnecessary polyfilling.
dschuff
approved these changes
Nov 4, 2026
dschuff
left a comment
Member
There was a problem hiding this comment.
LGTM assuming code assist is wrong about the versions and you're right :)
Collaborator
Author
I'm fairly sure my research (i.e. Gemini's research) is accurate.. and it matches canisuse. |
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Nov 5, 2026
Bump the default target browser versions in `src/settings.js`: - `MIN_CHROME_VERSION`: 85 (Aug 2020) -> 93 (Aug 2021) - `MIN_FIREFOX_VERSION`: 79 (Jul 2020) -> 92 (Sep 2021) - `MIN_SAFARI_VERSION`: 150000 (Sep 2021) -> 150400 (Mar 2022) This allows `$hasOwn` in `libcore.js` (introduced in emscripten-core#28129) to use the `Object.hasOwn` fast path by default, and allows `$waitAsyncPolyfilled` in `libatomic.js` (updated in emscripten-core#28172) to omit the Chrome < 91 user-agent check by default. Note: This does not effect the minimum browsers versions that we support or the behaviour -sLEGACY_VM_SUPPORT. See: emscripten-core#28125
sbc100
added a commit
that referenced
this pull request
Nov 5, 2026
Bump the default target browser versions in `src/settings.js`: - `MIN_CHROME_VERSION`: 85 (Aug 2020) -> 93 (Aug 2021) - `MIN_FIREFOX_VERSION`: 79 (Jul 2020) -> 92 (Sep 2021) - `MIN_SAFARI_VERSION`: 150000 (Sep 2021) -> 150400 (Mar 2022) This allows `$hasOwn` in `libcore.js` (introduced in #28129) to use the `Object.hasOwn` fast path by default, and allows `$waitAsyncPolyfilled` in `libatomic.js` (updated in #28172) to omit the Chrome < 91 user-agent check by default. Note: This does not effect the minimum browsers versions that we support or the behaviour -sLEGACY_VM_SUPPORT. See: #28125
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only include the
Atomics.waitAsyncpolyfill when targeting engines that lack support (Chrome < 91, Safari < 16.4, or Firefox < 145; Node.js has supportedAtomics.waitAsyncsince v16.0.0).Also guard the runtime Chrome < 91 user-agent regex check with
#if MIN_CHROME_VERSION < 91so it is omitted when targeting Chrome 91 or newer (such as the new defaultMIN_CHROME_VERSION=93in #28141).