mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-27 06:43:19 +08:00
util.promisify(fn) over a function typed any (an npm package method typed by its JavaScript, a bound method of an untyped value) was refused, because the promisified signature is only known at run time. A native wrapper now calls the function with the call's receiver, its arguments and a callback, and answers a promise: a truthy error rejects, otherwise the first value fulfills, the first settlement wins, and a synchronous throw rejects. util.promisify.custom functions are not consulted. The wrapper lives in its own runtime unit (scr_util_promisify.c), linked by the new utilPromisify feature, so other programs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>