jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

fix "call stack size exceeded" with many prereqs #362

Closed felix9 closed 4 years ago

felix9 commented 4 years ago

When a task has a large number of prereqs and parallelLimit > 1, each time a prereq finishes, it starts another prereq with a recursive call, and this can overflow the nodejs stack.

The fix is to defer execution of the next prereq with setImmediate.

I had previously fixed this problem for some cases, but there was a case that I missed.

This change fixes that case, and also adds a test that triggers that case.

mde commented 4 years ago

Awesome, thanks very much for this!

mde commented 4 years ago

@felix9: Also, invited you to join the JakeJS org. Keep the improvements coming!