mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-02 08:35:07 +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.
13 lines
465 B
JavaScript
13 lines
465 B
JavaScript
function make(values) { return new Set(values); }
|
|
const source = JSON.parse('[1,2,2,3]');
|
|
const set = make(source);
|
|
console.log(set.size, set.has(2), set.has(4));
|
|
console.log(make(null).size, make(undefined).size, make('aba').size);
|
|
const key = {};
|
|
/** @type {unknown[]} */
|
|
const entries = JSON.parse('[1,"1"]');
|
|
entries.push(key, key, NaN, NaN);
|
|
const mixed = make(entries);
|
|
console.log(mixed.size, mixed.has(key));
|
|
try {make(42);} catch(e) {console.log(e.name);}
|