Commit 2db2757
committed
wasm: make integer/string builtins available to the
`int.str()` (and the other int→string helpers), the `min_int`/`max_int` builtin
constants, and `tos()` live in `int_notd_no_imports.v` /
`string_notd_no_imports.v`, which were only compiled for `-os wasi`. So on
`-os browser`, `println(int)`, `'${int}'` interpolation, integer concatenation,
and `min_int`/`max_int` all failed (checker: "does not have a .str() function" /
"undefined ident: max_int"; or at the encoder, "called function int.str does
not exist").
These helpers are pure (no imports, no wasi/JS-specific calls), so move them
from `vlib/builtin/wasm/wasi/` to the shared `vlib/builtin/wasm/` dir; both
browser and wasi builds pick them up. No symbol conflicts — neither the browser
nor the wasi builtin defines `tos` or `int.str`. Follow-up to #27450 (which
fixed the browser `eprintln` panic).
Adds vlib/v/gen/wasm/tests/browser_int_builtins_test.v.-os browser target1 parent 1704098 commit 2db2757
3 files changed
Lines changed: 34 additions & 0 deletions
File tree
- vlib
- builtin/wasm
- v/gen/wasm/tests
File renamed without changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments