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>
This commit is contained in:
Ruben Bridgewater authored and Anna Henningsen committed 2018-12-05 16:53:58 +01:00
1 parent 6ccc80c82a
commit dcc82b37b6
26 files changed
+50 -72

No files matched your search

+1 -1
View File
@@ -149,7 +149,7 @@ function Agent(options) {
list: []
};
}
inherits(Agent, HttpAgent);
Object.setPrototypeOf(Agent.prototype, HttpAgent.prototype);
Agent.prototype.createConnection = createConnection;
Agent.prototype.getName = function getName(options) {