From ba28d342bb54258088b23791e0d86ac64d1b6ce9 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Wed, 17 Jul 2024 15:56:38 -0400 Subject: [PATCH] fs: fix not found `close` creation context --- lib/internal/fs/read/context.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/fs/read/context.js b/lib/internal/fs/read/context.js index b1a5d6ae03e953..2e00dc6a56fe97 100644 --- a/lib/internal/fs/read/context.js +++ b/lib/internal/fs/read/context.js @@ -15,7 +15,7 @@ const { const { Buffer } = require('buffer'); -const { FSReqCallback, close, read } = internalBinding('fs'); +const binding = internalBinding('fs'); const { AbortError, @@ -102,11 +102,11 @@ class ReadFileContext { length = MathMin(kReadFileBufferLength, this.size - this.pos); } - const req = new FSReqCallback(); + const req = new binding.FSReqCallback(); req.oncomplete = readFileAfterRead; req.context = this; - read(this.fd, buffer, offset, length, -1, req); + binding.read(this.fd, buffer, offset, length, -1, req); } close(err) { @@ -117,12 +117,12 @@ class ReadFileContext { return; } - const req = new FSReqCallback(); + const req = new binding.FSReqCallback(); req.oncomplete = readFileAfterClose; req.context = this; this.err = err; - close(this.fd, req); + binding.close(this.fd, req); } }