mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
- 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.
11 lines
472 B
JavaScript
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));
|