summaryrefslogtreecommitdiff
path: root/lib/fs.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-02-09 16:31:26 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-26 23:18:21 +0000
commitc3eb3efa315382d1073d6a126f4d888cf3e121ec (patch)
treed70cac1a8d1d984153fbfc5860132e42720e540d /lib/fs.js
parente9f2cecf1a14285574f9b6104dd690ef92495d74 (diff)
downloadandroid-node-v8-c3eb3efa315382d1073d6a126f4d888cf3e121ec.tar.gz
android-node-v8-c3eb3efa315382d1073d6a126f4d888cf3e121ec.tar.bz2
android-node-v8-c3eb3efa315382d1073d6a126f4d888cf3e121ec.zip
fs: fix functions executed in wrong context
The callback should run in the global scope and not in the FSReqWrap context. PR-URL: https://github.com/nodejs/node/pull/18668 Refs: https://github.com/nodejs/node/pull/12562 Refs: https://github.com/nodejs/node/pull/12976 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'lib/fs.js')
-rw-r--r--lib/fs.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/fs.js b/lib/fs.js
index abffde7b9e..543e6b8c61 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -737,7 +737,7 @@ fs.ftruncateSync = function(fd, len = 0) {
};
fs.rmdir = function(path, callback) {
- callback = maybeCallback(callback);
+ callback = makeCallback(callback);
path = getPathFromURL(path);
validatePath(path);
const req = new FSReqWrap();
@@ -1784,7 +1784,7 @@ fs.realpath = function realpath(p, options, callback) {
fs.realpath.native = function(path, options, callback) {
- callback = maybeCallback(callback || options);
+ callback = makeCallback(callback || options);
options = getOptions(options, {});
path = getPathFromURL(path);
validatePath(path);