Ver código fonte

EAGLESIX-2351: Fix potential issue with setTimeout

AFIK, this hasn't caused real issues but I'm making the change for correctness.
Chris Sexton 11 anos atrás
pai
commit
550bc9a777

+ 1 - 1
lib/pipeline/documentSources/CursorDocumentSource.js

@@ -167,7 +167,7 @@ proto.getCurrent = function getCurrent() {
  **/
  **/
 proto.setSource = function setSource(theSource, callback) {
 proto.setSource = function setSource(theSource, callback) {
 	if (theSource) throw new Error("CursorDocumentSource doesn't take a source"); //TODO: This needs to put back without the if once async is fully and properly supported
 	if (theSource) throw new Error("CursorDocumentSource doesn't take a source"); //TODO: This needs to put back without the if once async is fully and properly supported
-	if (callback) return setTimeout(callback, 0);
+	if (callback) return setImmediate(callback);
 };
 };
 
 
 /**
 /**