Skip to content

fs: check initialized flag and exit if false in FSWatcher onchange

After checking out the TODO comment in lib/internal/fs/watchers.js, this PR follows the suggestion to check initialized flag, and exits when "falsy", in favor to avoid firing events after the handle is closed.

https://github.com/nodejs/node/blob/e3340023f3c9759f9c6cff380cf75cbecb6130da/lib/internal/fs/watchers.js#L113-L116

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading