mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-12 04:19:53 +08:00
Represent ordinary JavaScript arrays with hole, value, and explicit-undefined states; add sparse side storage and carry missing values through the frontend, native backends, runtime, and Node-facing consumers.
13 lines
653 B
TypeScript
13 lines
653 B
TypeScript
// The fences around optional fields. Optional fields themselves compile —
|
|
// record fields AND class fields (undefined-armed union slots; corpus 967
|
|
// and 2047) — and `{a: string}` values COERCE into `{a?: string}` slots
|
|
// (the width-copy field lift). The string | undefined root compiles now
|
|
// (corpus 2788); number | undefined remains a BARE undefined-armed union
|
|
// with no root stringify lowering. Record FIELDS get Node's drop treatment;
|
|
// the CAST direction compiles — the checked-dynamic tree holds first-class undefined.
|
|
|
|
function mkMaybe(): number | undefined {
|
|
return undefined;
|
|
}
|
|
const stringifyBare = JSON.stringify(mkMaybe());
|