mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
18 lines
417 B
TypeScript
18 lines
417 B
TypeScript
// Int32 slots whose writes the program does not show: a parameter of a
|
|
// function used as a callback, and a field of instances that reach
|
|
// dynamic code.
|
|
import type { Int32 } from "@scriptc/types";
|
|
|
|
function double(x: Int32): Int32 {
|
|
return (x * 2) | 0;
|
|
}
|
|
|
|
class Box {
|
|
size: Int32 = 0;
|
|
}
|
|
|
|
const box = new Box();
|
|
const loose: any = box;
|
|
loose.size = 0.5;
|
|
console.log([1.5, 2].map(double).join(","), box.size);
|