From 2d48c6cd5895847a812bc327a79f4f996fcd0428 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Mon, 8 Nov 2021 10:18:08 +0100 Subject: [PATCH] call original fsBinding.open when collecting ReadFileContext proto to avoid creating open handle --- lib/readfilecontext.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/readfilecontext.js b/lib/readfilecontext.js index 4bd66ee..061ced2 100644 --- a/lib/readfilecontext.js +++ b/lib/readfilecontext.js @@ -17,6 +17,7 @@ exports.getReadFileContextPrototype = function() { let proto; fsBinding.open = (_path, _flags, _mode, req) => { proto = Object.getPrototypeOf(req.context); + originalOpen.apply(fsBinding, [_path, _flags, _mode, req]); }; fs.readFile('/ignored.txt', () => {});