Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit d248b04

Browse files
committed
fix: replace process.nextTick with setImmediate (fixes #22)
1 parent a542294 commit d248b04

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/MemoryFileSystem.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ MemoryFileSystem.prototype.createWriteStream = function(path, options) {
278278
try {
279279
var result = this[fn + "Sync"](path);
280280
} catch(e) {
281-
process.nextTick(function() {
281+
setImmediate(function() {
282282
callback(e);
283283
});
284284

285285
return;
286286
}
287-
process.nextTick(function() {
287+
setImmediate(function() {
288288
callback(null, result);
289289
});
290290
};
@@ -299,13 +299,13 @@ MemoryFileSystem.prototype.createWriteStream = function(path, options) {
299299
try {
300300
var result = this[fn + "Sync"](path, optArg);
301301
} catch(e) {
302-
process.nextTick(function() {
302+
setImmediate(function() {
303303
callback(e);
304304
});
305305

306306
return;
307307
}
308-
process.nextTick(function() {
308+
setImmediate(function() {
309309
callback(null, result);
310310
});
311311
};

0 commit comments

Comments
 (0)