Files
scriptc/tests/corpus/6814-node-island-handle-bytes/lib.cjs
T
Malte UblandClaude Opus 5.5 a1b6fda11c Run npm packages in Node islands: object handles and compiler routing (NI-4)
Node islands stack, part 2 of 11 (scriptc-perf/results/islands-prs/PLAN.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:49:52 -07:00

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);