Skip to content

Commit

Permalink
fs: add missed FSWatcher.prototype.start deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Oct 16, 2019
1 parent d247a8e commit 5f798e4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,20 @@ APIs that do not make sense to use in userland. File streams should always be
opened through their corresponding factory methods [`fs.createWriteStream()`][]
and [`fs.createReadStream()`][]) or by passing a file descriptor in options.
<a id="DEP0XXX"></a>
### DEP0XXX: `FSWatcher.start()`are internal
<!-- YAML
changes:
- version: REPLACEME
pr-url: REPLACEME
description: Runtime deprecation
-->
Type: Runtime
The `FSWatcher.prototype.start()` function is an undocumented internal API that
does not make ense to use in userland.
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`--throw-deprecation`]: cli.html#cli_throw_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
Expand Down
7 changes: 7 additions & 0 deletions lib/internal/fs/watchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const { toNamespacedPath } = require('path');
const { validateUint32 } = require('internal/validators');
const assert = require('internal/assert');

const { deprecate } = require('internal/util');

const kOldStatus = Symbol('kOldStatus');
const kUseBigint = Symbol('kUseBigint');

Expand Down Expand Up @@ -174,6 +176,11 @@ FSWatcher.prototype[kFSWatchStart] = function(filename,
}
};

FSWatcher.prototype.start = deprecate(
FSWatcher.prototype[kFSWatchStart],
'FSWatcher.prototype.start() is deprecated',
'DEP0XXX');

// 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 5f798e4

Please sign in to comment.