fs: improve errors in watchFile and unwatchFile
- Check if the watcher is active in JS land before invoking the binding, act as a noop if the state of the watcher does not match the expectation. This avoids firing 'stop' when the watcher is already stopped. - Update comments, validate more arguments and the type of the handle. - Handle the errors from uv_fs_poll_start - Create an `IsActive` helper method on StatWatcher PR-URL: https://github.com/nodejs/node/pull/19345 Refs: https://github.com/nodejs/node/pull/19089 Reviewed-By:James M Snell <jasnell@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Matteo Collina <matteo.collina@gmail.com>
parent
301f6cc5
Please register or sign in to comment