lib: named anonymous functions
PR-URL: https://github.com/nodejs/node/pull/20408 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Matheus Marchini <matheus@sthima.com>
This commit is contained in:
parent
4d8806fc40
commit
0930d7ec05
@ -247,7 +247,7 @@ fs.readFile = function(path, options, callback) {
|
|||||||
req.oncomplete = readFileAfterOpen;
|
req.oncomplete = readFileAfterOpen;
|
||||||
|
|
||||||
if (context.isUserFd) {
|
if (context.isUserFd) {
|
||||||
process.nextTick(function() {
|
process.nextTick(function tick() {
|
||||||
req.oncomplete(null, path);
|
req.oncomplete(null, path);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -304,7 +304,7 @@ ReadFileContext.prototype.close = function(err) {
|
|||||||
this.err = err;
|
this.err = err;
|
||||||
|
|
||||||
if (this.isUserFd) {
|
if (this.isUserFd) {
|
||||||
process.nextTick(function() {
|
process.nextTick(function tick() {
|
||||||
req.oncomplete(null);
|
req.oncomplete(null);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -554,7 +554,7 @@ fs.read = function(fd, buffer, offset, length, position, callback) {
|
|||||||
length |= 0;
|
length |= 0;
|
||||||
|
|
||||||
if (length === 0) {
|
if (length === 0) {
|
||||||
return process.nextTick(function() {
|
return process.nextTick(function tick() {
|
||||||
callback && callback(null, 0, buffer);
|
callback && callback(null, 0, buffer);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1219,7 +1219,7 @@ function writeAll(fd, isUserFd, buffer, offset, length, position, callback) {
|
|||||||
if (isUserFd) {
|
if (isUserFd) {
|
||||||
callback(writeErr);
|
callback(writeErr);
|
||||||
} else {
|
} else {
|
||||||
fs.close(fd, function() {
|
fs.close(fd, function close() {
|
||||||
callback(writeErr);
|
callback(writeErr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user