Files
scriptc/tests/corpus/js-buffer-callback-brand.cjs
Chris Tate a07998f667 Expand static three.js workflows and host integration (#621)
* Expand static three.js workflows and host integration

* Preserve JavaScript class state in static three.js workflows

* Preserve inferred JavaScript behavior across static workflows

* Preserve inferred callables and native compatibility boundaries

* Retain annotated JavaScript factory exports and bootstrap-safe call spreads

* Preserve Buffer and child callback identities in static packages

* Clarify JavaScript symbol spread support
2026-10-02 19:56:34 -05:00

21 lines
860 B
JavaScript

const { pbkdf2, randomBytes } = require("node:crypto");
const { deflate, inflate } = require("node:zlib");
async function main() {
await new Promise(resolve => pbkdf2("password", "salt", 2, 8, "sha256", (error, value) => {
console.log(error === null, Buffer.isBuffer(value), value.toString("hex"));
resolve(undefined);
}));
await new Promise(resolve => randomBytes(4, (error, value) => {
console.log(error === null, Buffer.isBuffer(value), value.toString("hex").length);
resolve(undefined);
}));
await new Promise(resolve => deflate("hello", (error, compressed) => {
console.log(error === null, Buffer.isBuffer(compressed));
inflate(compressed, (failure, value) => {
console.log(failure === null, Buffer.isBuffer(value), value.toString("utf8"), value.toString("hex"));
resolve(undefined);
});
}));
}
main();