lib: remove inherits() usage · nodejs/node@dcc82b3 (original) (raw)

`@@ -32,7 +32,6 @@ const {

`

32

32

`const assert = require('assert');

`

33

33

`const LazyTransform = require('internal/streams/lazy_transform');

`

34

34

``

35

``

`-

const { inherits } = require('util');

`

36

35

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

`

37

36

``

38

37

`// Lazy loaded for startup performance.

`

`@@ -124,7 +123,7 @@ function Cipher(cipher, password, options) {

`

124

123

`createCipher.call(this, cipher, password, options, true);

`

125

124

`}

`

126

125

``

127

``

`-

inherits(Cipher, LazyTransform);

`

``

126

`+

Object.setPrototypeOf(Cipher.prototype, LazyTransform.prototype);

`

128

127

``

129

128

`Cipher.prototype._transform = function _transform(chunk, encoding, callback) {

`

130

129

`this.push(this[kHandle].update(chunk, encoding));

`

`@@ -254,7 +253,7 @@ function addCipherPrototypeFunctions(constructor) {

`

254

253

`constructor.prototype.setAAD = Cipher.prototype.setAAD;

`

255

254

`}

`

256

255

``

257

``

`-

inherits(Cipheriv, LazyTransform);

`

``

256

`+

Object.setPrototypeOf(Cipheriv.prototype, LazyTransform.prototype);

`

258

257

`addCipherPrototypeFunctions(Cipheriv);

`

259

258

`legacyNativeHandle(Cipheriv);

`

260

259

``

`@@ -265,7 +264,7 @@ function Decipher(cipher, password, options) {

`

265

264

`createCipher.call(this, cipher, password, options, false);

`

266

265

`}

`

267

266

``

268

``

`-

inherits(Decipher, LazyTransform);

`

``

267

`+

Object.setPrototypeOf(Decipher.prototype, LazyTransform.prototype);

`

269

268

`addCipherPrototypeFunctions(Decipher);

`

270

269

`legacyNativeHandle(Decipher);

`

271

270

``

`@@ -277,7 +276,7 @@ function Decipheriv(cipher, key, iv, options) {

`

277

276

`createCipherWithIV.call(this, cipher, key, options, false, iv);

`

278

277

`}

`

279

278

``

280

``

`-

inherits(Decipheriv, LazyTransform);

`

``

279

`+

Object.setPrototypeOf(Decipheriv.prototype, LazyTransform.prototype);

`

281

280

`addCipherPrototypeFunctions(Decipheriv);

`

282

281

`legacyNativeHandle(Decipheriv);

`

283

282

``