Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: Add noop stub for FSWatcher.prototype.start #30160

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 backword-compatiblity for the end user
lholmquist marked this conversation as resolved.
Show resolved Hide resolved
// a no-op stub method has been added instead of
// totally removing FSWatcher.prototpye.start.
// This should not be documented
lholmquist marked this conversation as resolved.
Show resolved Hide resolved
FSWatcher.prototype.start = () => {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a comment explaining that this is to maximize backward-compatibility for end users but this function should not be documented? Otherwise, someone else might come along later and remove it as unused or something?

Copy link
Contributor Author

@lholmquist lholmquist Oct 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point and makes sense. I'll add a little comment


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