From b5bf77c9238e26f28373a22b9ac4577d2ad7f305 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Mon, 26 Oct 2026 22:54:21 -0700 Subject: [PATCH] chore(quest): small std gaps From #87's and #106's reports. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn --- quest/m2/README.md | 1 + quest/m2/ts-std-gaps.md | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 quest/m2/ts-std-gaps.md diff --git a/quest/m2/README.md b/quest/m2/README.md index a240a1026..c78343377 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -35,6 +35,7 @@ The fork's feature quests folded into the [exporter](/quest/m1/ffi-export.md); - [Shared ownership](/quest/m2/ts-shared.md) - `Arc`/`Rc`/`Weak` keep exact counts, and locks and atomics become plain values - [Share what the crate never changes in place](/quest/m2/ts-shared-read.md) - copies of `Copy` aggregates no one writes into in place go away, recovering #83's decode cost - [Matches TypeScript has already narrowed](/quest/m2/ts-narrow-test.md) - an inner match on a value an outer match decided passes `tsc` +- [Small std gaps](/quest/m2/ts-std-gaps.md) - `bool::then`, `iter::successors`, `usize::from(bool)`, and `None.ok_or` narrowing - [Default comparison methods](/quest/m2/ts-cmp-defaults.md) - inherited `ne`, `lt`, `le`, `gt`, `ge` and `[u8]` equality translate - [Copy-on-write strings](/quest/m2/ts-cow-str.md) - `Cow` translates, finishing `ietf/namespace.rs` - [Translate moq-net's model to TypeScript](/quest/m2/ts-model.md) - the driver grows from moq-net's codec to its model, for moq to compare against WASM diff --git a/quest/m2/ts-std-gaps.md b/quest/m2/ts-std-gaps.md new file mode 100644 index 000000000..1db902cb2 --- /dev/null +++ b/quest/m2/ts-std-gaps.md @@ -0,0 +1,19 @@ +# [S] Small std gaps + +## Goal + +rust2-ts translates `bool::then`, `bool::then_some`, `iter::successors`, and +`usize::from(bool)`, and `None.ok_or(e)` passes `tsc` where TypeScript narrowed the +value to `undefined`, so `discovery.rs`'s parent walk translates, proven by differential +tests against native Rust. + +## Plan + +Found by [#87](https://github.com/kixelated/rust2/pull/87) and +[#106](https://github.com/kixelated/rust2/pull/106) on 2026-10-27. + +- `then` calls its closure only when true, and `successors` calls its closure only for + the next item it yields; cover both laziness points in the differential tests. +- Report moq-net's census before and after. + +Public API: the translator's output.