TooTallNate / node-degenerator

Turns sync functions into async functions
20 stars 17 forks source link

turning function into generators only if function uses one of 'names' #10

Closed idobh2 closed 5 years ago

idobh2 commented 6 years ago

I've recently encountered some code that went through this module (it was a pac file used by pac-resolver). The code had some functions that were used as constructors, but never used any of the passed names in their call tree. This caused the degenerated code to crush for using generator function as a constructor.

I know this PR doesn't directly solve the constructor issue, but at least for constructor usage that does not invoke any of the names function it should do the trick

TooTallNate commented 5 years ago

Cool, thanks!