browserify / node-util

node.js util module as a module
MIT License
247 stars 88 forks source link

fix: callbackify resulting function should have one more argument #72

Open erossignon opened 2 years ago

erossignon commented 2 years ago

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.

ljharb commented 2 years ago

In which node version is this the case?

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

wobsoriano commented 1 year ago

Any updates on this? :)