Files
scriptc/tests/corpus/fresh-array-union-layout.js
Chris Tate bf21f47827 Compile collection metadata and heterogeneous JavaScript tables natively
- Preserve async factory results and mixed table layouts through inference and destructuring.
- Support checked Map and Object.fromEntries construction with native weak collections.
- Keep native weak-key lifetimes and engine-backed collection identities intact.
2026-09-28 22:20:24 -05:00

19 lines
495 B
JavaScript

let evaluated = 0;
function scalar() {
evaluated++;
return "u32";
}
function defineStruct(fields) {
for (const [name, type, options = {}] of fields) {
console.log(name, Array.isArray(type) ? type.join(",") : type, options.lengthOf);
}
}
defineStruct([
["startCols", ["u32"]],
["startColsLen", "u32", { lengthOf: "startCols" }],
["widthCols", ["u32"]],
["widthColsLen", "u32", { lengthOf: "widthCols" }],
["widthColsMax", scalar()],
]);
console.log("evaluated", evaluated);