Skip to content

Don't use js.Map in ClassValue when targeting pure Wasm#1

Open
lostflydev wants to merge 1 commit intoscala-wasmfrom
fix/147-classvalue-linktime
Open

Don't use js.Map in ClassValue when targeting pure Wasm#1
lostflydev wants to merge 1 commit intoscala-wasmfrom
fix/147-classvalue-linktime

Conversation

@lostflydev
Copy link
Owner

Add LinkingInfo.targetPureWasm guards to ClassValue so the linker can dead-code-eliminate the js.Map branch for pure Wasm builds, always using HashMap instead.

Fixes scala-wasm#147

@lostflydev lostflydev force-pushed the fix/147-classvalue-linktime branch from 3f9e613 to d78dc6b Compare March 9, 2026 08:14
lostflydev pushed a commit that referenced this pull request Mar 10, 2026
- Remove top-level vals with JS types (RegExp, js.Function1) that caused
  linker errors in pure Wasm mode; inline them into linkTimeIf JS branches
- Convert quoteStr from val to def so JS function is created lazily
- Restore ClassValueTest exclusion (belongs to separate PR #1)
Add LinkingInfo.targetPureWasm guards to ClassValue so the linker
can dead-code-eliminate the js.Map branch for pure Wasm builds,
always using HashMap instead.

Enable ClassValueTest in pure Wasm test suite.

Fixes scala-wasm#147
@lostflydev lostflydev force-pushed the fix/147-classvalue-linktime branch from d78dc6b to 702d48e Compare March 10, 2026 14:45
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.

Don't use js.Map in ClassValue when targeting pure Wasm

1 participant