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

Commit

Permalink
fix: replace process.nextTick with setImmediate (fixes #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 7, 2016
1 parent a542294 commit d248b04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/MemoryFileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ MemoryFileSystem.prototype.createWriteStream = function(path, options) {
try {
var result = this[fn + "Sync"](path);
} catch(e) {
process.nextTick(function() {
setImmediate(function() {
callback(e);
});

return;
}
process.nextTick(function() {
setImmediate(function() {
callback(null, result);
});
};
Expand All @@ -299,13 +299,13 @@ MemoryFileSystem.prototype.createWriteStream = function(path, options) {
try {
var result = this[fn + "Sync"](path, optArg);
} catch(e) {
process.nextTick(function() {
setImmediate(function() {
callback(e);
});

return;
}
process.nextTick(function() {
setImmediate(function() {
callback(null, result);
});
};
Expand Down

0 comments on commit d248b04

Please sign in to comment.