Files
scriptc/tests/corpus/optional-native-callables.js
Chris Tate f668fc4bfd Support native runtime values used by OpenTUI
- 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.
2026-09-28 19:01:50 -05:00

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);