mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
- Add shared ArrayBuffer storage and native Unicode grapheme segmentation. - Preserve builtin modules, globals, and byte views across JavaScript bindings. - Compile package initialization expressions and optional native callables.
7 lines
344 B
JavaScript
7 lines
344 B
JavaScript
const getLength = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength")?.get;
|
|
const buffer = new ArrayBuffer(12);
|
|
if (getLength) console.log(typeof getLength, getLength.call(buffer));
|
|
const empty = /** @type {unknown} */ ({});
|
|
const none = Object.getOwnPropertyDescriptor(empty, "missing")?.get;
|
|
console.log(none === undefined);
|