Files
scriptc/tests/diagnostics/dataview.ts
Chris Tate 1600935411 Add static-native BigInt support (#346)
* feat: add static BigInt support

* fix: prevent BigInt width overflow on WASI

* fix: harden BigInt formatting sizes

* test: record BigInt WASI parity baseline
2026-09-18 00:21:12 -05:00

15 lines
458 B
TypeScript

// The DataView fences: `.buffer` escaping the one composed position that
// consumes it and a constructor
// over something that isn't a typed array's `.buffer`.
const buf = new Uint8Array(8);
const view = new DataView(buf.buffer);
// '.buffer' only compiles inside new DataView(x.buffer, ...).
const escaped = buf.buffer;
// The constructor wants a typed array's own '.buffer'.
const ab = new ArrayBuffer(8);
const direct = new DataView(ab);
void view;