Files
scriptc/tests/corpus/3073-optional-callable-module.js
Chris Tate cbb8fc380a Link native FFI libraries and callbacks without a JavaScript engine
- Add exact 64-bit and pointer ABIs, static node:ffi bindings, and Darwin framework linking.
- Support native memory views and reusable callback pools with checked conversions and lifetime handling.
- Preserve the JavaScript values, accessors, and module bindings used during renderer initialization.
2026-09-29 08:07:03 -05:00

11 lines
506 B
JavaScript

console.log(early());
var getLength = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength")?.get;
function early() { return getLength === undefined; }
function isBuffer(value) {
if (value === null || typeof value !== "object" || getLength == null) return false;
try { getLength.call(value); return true; } catch { return false; }
}
console.log(early(), isBuffer(new ArrayBuffer(4)), isBuffer(JSON.parse('{}')));
getLength = undefined;
console.log(early(), isBuffer(new ArrayBuffer(4)));