Skip to content

Commit

Permalink
fs: add noop stub for FSWatcher.prototype.start
Browse files Browse the repository at this point in the history
* Motivation: In a previous PR, #29905, I made this method a private
method since it had no value to the user.

There was discussion that maybe it should have been a runtime
deprecation first, but was ultimatley decided that for this
type of method, a noop stub was a better option.

This Adds back in the method, but as a noop stub, while also keeping
the real implementation private

PR-URL: #30160
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
lholmquist authored and MylesBorins committed Nov 17, 2019
1 parent e51beef commit bb6f944
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/fs/watchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ FSWatcher.prototype[kFSWatchStart] = function(filename,
}
};

// To maximize backward-compatiblity for the end user,
// a no-op stub method has been added instead of
// totally removing FSWatcher.prototpye.start.
// This should not be documented.
FSWatcher.prototype.start = () => {};

// This method is a noop if the watcher has not been started or
// has already been closed.
FSWatcher.prototype.close = function() {
Expand Down

0 comments on commit bb6f944

Please sign in to comment.