mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-09 18:09:47 +08:00
Node islands stack, part 2 of 11 (scriptc-perf/results/islands-prs/PLAN.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
415 B
JavaScript
13 lines
415 B
JavaScript
"use strict";
|
|
let kept;
|
|
exports.makeBuffer = () => (kept = Buffer.from("hello"));
|
|
exports.kept = () => kept;
|
|
exports.read = (b) => `${b.constructor.name} ${Buffer.isBuffer(b)} [${Array.from(b).join(",")}]`;
|
|
exports.fill = (b, v) => {
|
|
b.fill(v);
|
|
return b.length;
|
|
};
|
|
exports.same = (a, b) => a === b;
|
|
exports.floats = () => new Float64Array([1.5, -0, NaN]);
|
|
exports.sum = (arr) => arr.reduce((a, b) => a + b, 0);
|