Skip to content

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

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:jslib_refactor
Open

[jslib] Minor cleanups to JS library files. NFC#27441
sbc100 wants to merge 1 commit 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
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`.
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.

1 participant