Files
scriptc/tests/corpus/3071-checked-specialization-narrowing.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
472 B
JavaScript

function classify(value) {
if (typeof value === "bigint") return value >= 0n ? "positive bigint" : "negative bigint";
if (typeof value === "number") return value >= 0 ? "positive number" : "negative number";
if (typeof value === "string") return value.toUpperCase();
return "other";
}
const values = JSON.parse('[null,4,-2,"hello",false]');
values.push(9007199254740993n);
values.push(-9007199254740993n);
for (const value of values) console.log(classify(value));