summaryrefslogtreecommitdiff
path: root/src/node_dir.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-03-05 03:02:57 +0100
committerAnna Henningsen <anna@addaleax.net>2020-04-06 02:06:43 +0200
commitf4c2dff4e61570e6b8512f2a41ac2d17c2473a5e (patch)
tree1aafd878ebf5d5019b99f2cfa0d78a0a2410f98a /src/node_dir.cc
parent1216e8f7773c14b12e93e97ed19655c248c4c6bb (diff)
downloadnode-new-f4c2dff4e61570e6b8512f2a41ac2d17c2473a5e.tar.gz
src: move fs state out of Environment
Moves state that is specific to the `fs` binding into the `fs` binding implementation as a cleanup. PR-URL: https://github.com/nodejs/node/pull/32538 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_dir.cc')
-rw-r--r--src/node_dir.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_dir.cc b/src/node_dir.cc
index 9923f04277..c4aaf4bcd3 100644
--- a/src/node_dir.cc
+++ b/src/node_dir.cc
@@ -152,7 +152,7 @@ void DirHandle::Close(const FunctionCallbackInfo<Value>& args) {
dir->closing_ = false;
dir->closed_ = true;
- FSReqBase* req_wrap_async = GetReqWrap(env, args[0]);
+ FSReqBase* req_wrap_async = GetReqWrap(args, 0);
if (req_wrap_async != nullptr) { // close(req)
AsyncCall(env, req_wrap_async, args, "closedir", UTF8, AfterClose,
uv_fs_closedir, dir->dir());
@@ -252,7 +252,7 @@ void DirHandle::Read(const FunctionCallbackInfo<Value>& args) {
dir->dir_->dirents = dir->dirents_.data();
}
- FSReqBase* req_wrap_async = GetReqWrap(env, args[2]);
+ FSReqBase* req_wrap_async = GetReqWrap(args, 2);
if (req_wrap_async != nullptr) { // dir.read(encoding, bufferSize, req)
AsyncCall(env, req_wrap_async, args, "readdir", encoding,
AfterDirRead, uv_fs_readdir, dir->dir());
@@ -320,7 +320,7 @@ static void OpenDir(const FunctionCallbackInfo<Value>& args) {
const enum encoding encoding = ParseEncoding(isolate, args[1], UTF8);
- FSReqBase* req_wrap_async = GetReqWrap(env, args[2]);
+ FSReqBase* req_wrap_async = GetReqWrap(args, 2);
if (req_wrap_async != nullptr) { // openDir(path, encoding, req)
AsyncCall(env, req_wrap_async, args, "opendir", encoding, AfterOpenDir,
uv_fs_opendir, *path);