AvianFlu / ncp

Asynchronous recursive file copying with Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

recursive process.nextTick broken in latest io.js and node.js

MylesBorins opened this issue · comments

I'm unsure as to why ncp is not throwing this error, but node is supposed to throw when writing an recursive function that uses process.nexTick.

(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.

It looks like the current implementation found at --> https://github.com/AvianFlu/ncp/blob/master/lib/ncp.js#L55-L61 is blocking the thread... makes me sad.

I'm looking at ways to fix this, but commenting out the three lines that call to defer does stop ncp form breaking on iojs and node 0.12

/cc @AvianFlu

This appears to be a dupe of #79

The broken "modern" check is what is causing this bug as well, since process.nextTick is being used instead of setImmediate