This release adds 2 notable features for engineering teams evaluating rollout.
✓ No known CVEs patched in this version
Topics
+5 more
Summary
AI summaryRest‑parameter bundling fixed for class method dispatch and fast‑math flag added.
Full changelog
Closes #484 (rest-parameter bundling for class method dispatch) + #139 (fast-math opt-in).
#484 — rest-parameter bundling for class methods
`class Builder { with(id, ...args: T extends void ? [] | [void] : [T]) }` (or any `...args` rest pattern on a class method) crashed with `TypeError: Cannot read properties of undefined (reading 'length')`. The conditional rest type was a red herring — even `...args: any[]` would have shown the same gap.
Root cause: codegen's class-method dispatch table only tracked `method_param_counts: HashMap<(class, method), usize>` — no rest-parameter flag. Call sites padded missing args with `TAG_UNDEFINED` (issue #235 path) but never bundled trailing args into a `js_array_alloc(n)` rest array. Free-standing functions had this right via `func_signatures.has_rest` since v0.5.0; class methods didn't.
Fix: parallel `method_has_rest: HashMap<(class, method), bool>` populated alongside `method_param_counts` in `compile_module`, threaded through `CrossModuleCtx` + `FnCtx`, and consulted in `lower_call.rs`'s static-dispatch + virtual-override arm to emit the same `js_array_alloc + js_array_push_f64` sequence the freestanding-call path already uses.
After fix: `b.with(1)` correctly passes `args=[]` (length 0) to the method body.
#139 — fast-math opt-in (parallel work)
Per-instruction LLVM `reassoc + contract` FMF flags on `fadd`/`fsub`/`fmul`/`fdiv`/`frem`/`fneg` are now gated on `--fast-math` CLI flag (also `PERRY_FAST_MATH=1` env, also `"perry": { "fastMath": true }` in package.json). Default OFF means Perry produces bit-exact f64 output with Node on most FP-heavy code; the `scripts/fp_fuzz.mjs` differential fuzzer drops divergence from ~30% → ~6%. New docs page `docs/src/cli/fast-math.md`. Cache key in `object_cache.rs` gains a `fmath` field so toggling the flag invalidates stale `.o` bytes.
Bug fixes since v0.5.583
- v0.5.584-585: rest-parameter bundling for class methods (#484)
- v0.5.585: fast-math opt-in (#139)
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About perry
A native TypeScript compiler written in Rust. Compiles TypeScript directly to executables using SWC and LLVM.
Related context
Beta — feedback welcome: [email protected]