Skip to content

[jslib] Minor cleanups to JS library files. NFC - #27441

Merged
sbc100 merged 2 commits into
emscripten-core:mainfrom
sbc100:jslib_refactor
Jul 30, 2026
Merged

[jslib] Minor cleanups to JS library files. NFC#27441
sbc100 merged 2 commits into
emscripten-core:mainfrom
sbc100:jslib_refactor

Conversation

@sbc100

@sbc100 sbc100 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Similar to #27425 but applied to the whole JS library

  • Replace explicit zero checks (=== 0, !== 0) with implicit truthy/falsy checks (!x, x).
  • Replace .length === 0 checks with !arr.length.
  • Simplify null/undefined/zero check in src/lib/libccall.js to if (str).
  • Use for (var byte of data) loop in src/lib/libbrowser.js.

@sbc100
sbc100 requested a review from kripken July 29, 2026 20:25
Comment thread src/lib/libcore.js Outdated
sbc100 added 2 commits July 30, 2026 09:46
Similar to emscripten-core#27425 but applied to the whole JS library

- Replace explicit zero checks (`=== 0`, `!== 0`) with implicit
  truthy/falsy checks (`!x`, `x`).
- Replace `.length === 0` checks with `!arr.length`.
- Simplify null/undefined/zero check in `src/lib/libccall.js` to
  `if (str)`.
- Use `for (var byte of data)` loop in `src/lib/libbrowser.js`.
@sbc100
sbc100 merged commit 306c32f into emscripten-core:main Jul 30, 2026
41 checks passed
@sbc100
sbc100 deleted the jslib_refactor branch July 30, 2026 18:57
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.

2 participants