Skip to content

Remove support for wasm2js (WASM=0 and WASM=2) - #27933

Draft
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:remove-wasm2js
Draft

sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:remove-wasm2js

Conversation

@sbc100

@sbc100 sbc100 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

wasm2js was marked as deprecated in #27655. This change removes
support for compiling to JavaScript via wasm2js (-sWASM=0 and
-sWASM=2), moving WASM to LEGACY_SETTINGS with [1] as the only
valid value.

Also remove src/wasm2js.js, tools/js_optimizer.py, and the
minifyGlobals, minifyLocals, and emitSymbolMap passes in
tools/acorn-optimizer.mjs.

In addition to removing the 6 wasm2js* core test suites and wasm2js
parameterized test variants (including @also_with_wasm2js), this
removes 57 test methods:

  • 39 @only_wasm2js tests in test/test_core.py that tested basic
    C/C++ codegen (such as i64 arithmetic, va_arg, bitfields, and
    float conversions) which were only kept for wasm2js coverage since
    LLVM already tests its own Wasm codegen upstream.
  • 12 wasm2js-specific tests across test/test_core.py (2),
    test/test_other.py (6), and test/test_browser.py (4) that
    directly tested -sWASM=0 or -sWASM=2.
  • 3 tools/js_optimizer.py tests in test/test_other.py, since the
    Python JS optimizer wrapper was only used by the wasm2js pipeline.
  • 2 long-skipped fastcomp invoke_* tests in test/test_other.py.
  • 1 test_preallocated_heap test in test/test_browser.py, which
    tested preallocating a plain ArrayBuffer (Module['buffer']) with
    -sWASM=0 (an asm.js-era feature not applicable to Wasm).

Fixes: #27608

`wasm2js` was marked as deprecated in emscripten-core#27655. This change removes
support for compiling to JavaScript via `wasm2js` (`-sWASM=0` and
`-sWASM=2`), moving `WASM` to `LEGACY_SETTINGS` with `[1]` as the only
valid value.

Also remove `src/wasm2js.js`, `tools/js_optimizer.py`, and the
`minifyGlobals`, `minifyLocals`, and `emitSymbolMap` passes in
`tools/acorn-optimizer.mjs`.

In addition to removing the 6 `wasm2js*` core test suites and `wasm2js`
parameterized test variants (including `@also_with_wasm2js`), this
removes 57 test methods:
- 39 `@only_wasm2js` tests in `test/test_core.py` that tested basic
  C/C++ codegen (such as `i64` arithmetic, `va_arg`, bitfields, and
  float conversions) which were only kept for `wasm2js` coverage since
  LLVM already tests its own Wasm codegen upstream.
- 12 `wasm2js`-specific tests across `test/test_core.py` (2),
  `test/test_other.py` (6), and `test/test_browser.py` (4) that
  directly tested `-sWASM=0` or `-sWASM=2`.
- 3 `tools/js_optimizer.py` tests in `test/test_other.py`, since the
  Python JS optimizer wrapper was only used by the `wasm2js` pipeline.
- 2 long-skipped fastcomp `invoke_*` tests in `test/test_other.py`.
- 1 `test_preallocated_heap` test in `test/test_browser.py`, which
  tested preallocating a plain `ArrayBuffer` (`Module['buffer']`) with
  `-sWASM=0` (an asm.js-era feature not applicable to Wasm).

Fixes: emscripten-core#27608
@sbc100 sbc100 changed the title Remove support wasm2js (WASM=0 and WASM=2) Remove support for wasm2js (WASM=0 and WASM=2) Oct 9, 2026

This branch has not been deployed

No deployments
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.

Tracking issue for the deprecation and removal of wasm2js (AKA WASM=0)

1 participant