Files
node/lib
Joyee Cheung 6c25f2ea49 fs: improve errors thrown from fs.watch()
- Add an accessor property `initialized `to FSEventWrap to
  check the state of the handle from the JS land
- Introduce ERR_FS_WATCHER_ALREADY_STARTED so calling start()
  on a watcher that is already started will throw instead of
  doing nothing silently.
- Introduce ERR_FS_WATCHER_NOT_STARTED so calling close()
  on a watcher that is already closed will throw instead of
  doing nothing silently.
- Validate the filename passed to fs.watch()
- Assert that the handle in the watcher are instances of
  FSEvent instead of relying on the illegal invocation error
  from the VM.
- Add more assertions in FSEventWrap methods now that we check
  `initialized` and the filename in JS land before invoking
  the binding.
- Use uvException instead of errornoException to create
  the errors with the error numbers from libuv to make them
  consistent with other errors in fs.

TODO:

- Improve fs.watchFile() the same way this patch improves fs.watch()
- It seems possible to fire both rename and change event from libuv
  together now that we can check if the handle is closed via
  `initialized` in JS land.

PR-URL: https://github.com/nodejs/node/pull/19089
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-08 01:14:53 +08:00
..
2018-03-05 08:35:44 -06:00
2018-03-05 19:51:30 +01:00
2018-02-22 13:36:22 +00:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-06 07:50:01 -08:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-05 19:51:30 +01:00
2018-03-06 13:31:56 +01:00