lib/_copy: if setImmediate is not available, fallback to process.nextTick (Node v0.8)

This commit is contained in:
JP Richardson 2015-01-28 13:30:29 -06:00
parent 757863933b
commit 61bbb4f668

View File

@ -49,9 +49,10 @@ function ncp (source, dest, options, callback) {
}
function getStats(source) {
var defer = global.setImmediate || process.nextTick
var stat = dereference ? fs.stat : fs.lstat
if (running >= limit) {
return setImmediate(function () {
return defer(function () {
getStats(source)
})
}