mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
* Expand static three.js workflows and host integration * Preserve JavaScript class state in static three.js workflows * Preserve inferred JavaScript behavior across static workflows * Preserve inferred callables and native compatibility boundaries * Retain annotated JavaScript factory exports and bootstrap-safe call spreads * Preserve Buffer and child callback identities in static packages * Clarify JavaScript symbol spread support
14 lines
573 B
TypeScript
14 lines
573 B
TypeScript
const values = new Array<number>(3);
|
|
values[0] = 1;
|
|
values[2] = 3;
|
|
const boxed: unknown = values;
|
|
const checked = boxed as number[];
|
|
console.log(checked.length, 0 in checked, 1 in checked, 2 in checked, checked.join(","));
|
|
console.log(Object.keys(boxed as object).join(","), JSON.stringify(boxed));
|
|
checked[1] = 2;
|
|
console.log(values.join(","), (boxed as number[]).join(","));
|
|
checked.length = 5;
|
|
console.log(3 in values, Object.keys(boxed as object).join(","));
|
|
const copied = structuredClone(boxed) as number[];
|
|
console.log(copied.length, 3 in copied, copied.join(","));
|