diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-11-30 17:55:48 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-12-05 16:53:58 +0100 |
commit | dcc82b37b631d636e0fefc8272c357ec4a7d6df2 (patch) | |
tree | 0a036ccfa7448c8d50628831084e9863a14a0766 /lib/internal/fs/watchers.js | |
parent | 6ccc80c82a7e21bc9315d6fdccea62ce8e2712a7 (diff) | |
download | android-node-v8-dcc82b37b631d636e0fefc8272c357ec4a7d6df2.tar.gz android-node-v8-dcc82b37b631d636e0fefc8272c357ec4a7d6df2.tar.bz2 android-node-v8-dcc82b37b631d636e0fefc8272c357ec4a7d6df2.zip |
lib: remove `inherits()` usage
This switches all `util.inherits()` calls to use
`Object.setPrototypeOf()` instead. In fact, `util.inherits()` is
mainly a small wrapper around exactly this function while adding
the `_super` property on the object as well.
Refs: #24395
PR-URL: https://github.com/nodejs/node/pull/24755
Refs: https://github.com/nodejs/node/issues/24395
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/internal/fs/watchers.js')
-rw-r--r-- | lib/internal/fs/watchers.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js index e026aa8192..46a520a45c 100644 --- a/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js @@ -19,7 +19,6 @@ const { const { toNamespacedPath } = require('path'); const { validateUint32 } = require('internal/validators'); const { toPathIfFileURL } = require('internal/url'); -const util = require('util'); const assert = require('assert'); const kOldStatus = Symbol('kOldStatus'); @@ -36,7 +35,7 @@ function StatWatcher(bigint) { this[kOldStatus] = -1; this[kUseBigint] = bigint; } -util.inherits(StatWatcher, EventEmitter); +Object.setPrototypeOf(StatWatcher.prototype, EventEmitter.prototype); function onchange(newStatus, stats) { const self = this[owner_symbol]; @@ -132,7 +131,7 @@ function FSWatcher() { } }; } -util.inherits(FSWatcher, EventEmitter); +Object.setPrototypeOf(FSWatcher.prototype, EventEmitter.prototype); // FIXME(joyeecheung): this method is not documented. |