diff options
author | Lucas Holmquist <lholmqui@redhat.com> | 2019-10-09 08:40:30 -0400 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-10-12 19:56:07 -0700 |
commit | 7eacb7438960da98eaf210e232ea93a98e247b72 (patch) | |
tree | bea0591ab3e77b12c2c0dd7e0f601efaf06a403d /test/parallel/test-fs-watch.js | |
parent | 40ef537d6949f723d2d4af841d95bd9d4b28ea81 (diff) | |
download | android-node-v8-7eacb7438960da98eaf210e232ea93a98e247b72.tar.gz android-node-v8-7eacb7438960da98eaf210e232ea93a98e247b72.tar.bz2 android-node-v8-7eacb7438960da98eaf210e232ea93a98e247b72.zip |
fs: make FSWatcher.start private
* This is a semver-major change to rename the FSWatcher.start
function to FSWatcher._start to make it private
The motivation here is that it serves no purpose to the end user.
An instance of FSWatcher is returned when a user calls fs.watch,
which will call the start method. A user can't create an instance
of a FSWatcher directly. If the start method is called by a user
it is a noop since the watcher has already started. Calling start
after a watcher has closed is also a noop
PR-URL: https://github.com/nodejs/node/pull/29905
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/parallel/test-fs-watch.js')
-rw-r--r-- | test/parallel/test-fs-watch.js | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/test/parallel/test-fs-watch.js b/test/parallel/test-fs-watch.js index e596f32a76..fb674bbfea 100644 --- a/test/parallel/test-fs-watch.js +++ b/test/parallel/test-fs-watch.js @@ -57,8 +57,6 @@ for (const testCase of cases) { }); watcher.on('close', common.mustCall(() => { watcher.close(); // Closing a closed watcher should be a noop - // Starting a closed watcher should be a noop - watcher.start(); })); watcher.on('change', common.mustCall(function(eventType, argFilename) { if (interval) { @@ -71,16 +69,11 @@ for (const testCase of cases) { assert.strictEqual(eventType, 'change'); assert.strictEqual(argFilename, testCase.fileName); - // Starting a started watcher should be a noop - watcher.start(); - watcher.start(pathToWatch); - watcher.close(); // We document that watchers cannot be used anymore when it's closed, // here we turn the methods into noops instead of throwing watcher.close(); // Closing a closed watcher should be a noop - watcher.start(); // Starting a closed watcher should be a noop })); // Long content so it's actually flushed. toUpperCase so there's real change. |