Skip to content

Commit

Permalink
call original fsBinding.open when collecting ReadFileContext proto to…
Browse files Browse the repository at this point in the history
… avoid creating open handle
  • Loading branch information
jloleysens committed Nov 8, 2021
1 parent 313cd08 commit 2d48c6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/readfilecontext.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {});
Expand Down

0 comments on commit 2d48c6c

Please # to comment.