mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
In TypeScript, tee(), pipeTo() and pipeThrough() on a ReadableStream were refused with SC2020, and the WritableStream constructor and a TransformStream with a transformer had no lowering, while JavaScript programs reach all of them through the web stream classes (scr_webstreams.c). A TypeScript program that uses one of them now builds its ReadableStream, WritableStream and TransformStream values with those classes, as JavaScript does, and %main installs them, so a native stream such as a Response body answers the three methods through its web view. A program that uses only getReader(), cancel(), locked and the identity transform keeps the native streams and builds to the same binary. The fallback declarations gain UnderlyingSink and Transformer, the WritableStream constructor takes a sink and the TransformStream constructor a transformer and queuing strategies, and their controllers map to checked-dynamic handles. The fetch profile lists the three methods as static with the new static-web-streams fetch fixture as their differential evidence, and keeps them in the set that links the classes. The surface manifest is regenerated, and the surface-manifest probe that kept tee() and pipeTo() fenced now fences values() and the async iterator. Adds the static-web-streams fixture and the corpus program web-streams-typed-pipes.ts, with its corpus cost and order baseline.