Detect Function Argument Names with JavaScript

added by bpwndaddy
10/22/2015 3:31:25 PM

841 Views

I was recently looking over the promisify-node code to see how the author was able to convert basic functions and objects to a promised-based API. I quickly realized that they were reading function signatures to look for common callback argument names like `callback` and `cb`. The strategy seemed odd but probably necessary.


0 comments