diff options
Diffstat (limited to 'lib/internal/crypto/cipher.js')
-rw-r--r-- | lib/internal/crypto/cipher.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index 133b1e5153..add56eae68 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -1,6 +1,8 @@ 'use strict'; -const { Object } = primordials; +const { + ObjectSetPrototypeOf, +} = primordials; const { RSA_PKCS1_OAEP_PADDING, @@ -126,8 +128,8 @@ function Cipher(cipher, password, options) { createCipher.call(this, cipher, password, options, true); } -Object.setPrototypeOf(Cipher.prototype, LazyTransform.prototype); -Object.setPrototypeOf(Cipher, LazyTransform); +ObjectSetPrototypeOf(Cipher.prototype, LazyTransform.prototype); +ObjectSetPrototypeOf(Cipher, LazyTransform); Cipher.prototype._transform = function _transform(chunk, encoding, callback) { this.push(this[kHandle].update(chunk, encoding)); @@ -239,8 +241,8 @@ function addCipherPrototypeFunctions(constructor) { constructor.prototype.setAAD = Cipher.prototype.setAAD; } -Object.setPrototypeOf(Cipheriv.prototype, LazyTransform.prototype); -Object.setPrototypeOf(Cipheriv, LazyTransform); +ObjectSetPrototypeOf(Cipheriv.prototype, LazyTransform.prototype); +ObjectSetPrototypeOf(Cipheriv, LazyTransform); addCipherPrototypeFunctions(Cipheriv); function Decipher(cipher, password, options) { @@ -250,8 +252,8 @@ function Decipher(cipher, password, options) { createCipher.call(this, cipher, password, options, false); } -Object.setPrototypeOf(Decipher.prototype, LazyTransform.prototype); -Object.setPrototypeOf(Decipher, LazyTransform); +ObjectSetPrototypeOf(Decipher.prototype, LazyTransform.prototype); +ObjectSetPrototypeOf(Decipher, LazyTransform); addCipherPrototypeFunctions(Decipher); @@ -262,8 +264,8 @@ function Decipheriv(cipher, key, iv, options) { createCipherWithIV.call(this, cipher, key, options, false, iv); } -Object.setPrototypeOf(Decipheriv.prototype, LazyTransform.prototype); -Object.setPrototypeOf(Decipheriv, LazyTransform); +ObjectSetPrototypeOf(Decipheriv.prototype, LazyTransform.prototype); +ObjectSetPrototypeOf(Decipheriv, LazyTransform); addCipherPrototypeFunctions(Decipheriv); module.exports = { |