node-util icon indicating copy to clipboard operation
node-util copied to clipboard

fix: callbackify resulting function should have one more argument

Open erossignon opened this issue 2 years ago • 2 comments

Fixing a callbackify behavior that is different from the NodeJS implementation ( when NodeJS version >= 12.0)

In node, the callbackified function has a length that is one more than the length of the original function. For instance:

     callbackify((a,b,c)=>Promise<void>).length = 4 

this is not the case in the current version (<=0.12.4) where

   callbackify((a,b,c)=>Promise<void>).length = 3 

This PR provides the fix and the associated unit test.

erossignon avatar May 18 '22 06:05 erossignon

In which node version is this the case?

Bear in mind that the current node-util largely matches node 0.12.

ljharb avatar May 18 '22 16:05 ljharb

Any updates on this? :)

wobsoriano avatar Dec 07 '22 21:12 wobsoriano