mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 08:35:07 +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.
14 lines
531 B
TypeScript
14 lines
531 B
TypeScript
// Builtin conversions consume the missing value produced by an unchecked
|
|
// array read with JavaScript's own undefined semantics.
|
|
const values = ["a=1"];
|
|
const present = values[0];
|
|
const missing = values[9];
|
|
|
|
console.log(new URLSearchParams(present).toString());
|
|
console.log(new URLSearchParams(missing).toString(), new URLSearchParams(missing).size);
|
|
|
|
console.log(Number(present), Number.isNaN(Number(missing)));
|
|
|
|
console.log(JSON.stringify(present));
|
|
console.log(JSON.stringify(missing), JSON.stringify(missing) === undefined);
|