From bb1c9c695eccbdbb7ebd2254945240d392dc990a Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 19 Apr 2018 11:13:17 +0200 Subject: [PATCH 1/2] lib: remove unused binding const This commit removes the binding const as it is only used in one place which is in the following line. --- lib/_tls_common.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/_tls_common.js b/lib/_tls_common.js index fb6ac34d1e68ad..e02835c59b1e23 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -34,8 +34,7 @@ const { SSL_OP_CIPHER_SERVER_PREFERENCE } = process.binding('constants').crypto; // Lazily loaded var crypto = null; -const binding = process.binding('crypto'); -const NativeSecureContext = binding.SecureContext; +const NativeSecureContext = process.binding('crypto').SecureContext; function SecureContext(secureProtocol, secureOptions, context) { if (!(this instanceof SecureContext)) { From 03faa3f08248f9bfc9ab43570c0ceb4333033de0 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 19 Apr 2018 13:04:46 +0200 Subject: [PATCH 2/2] squash: use object destructoring --- lib/_tls_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_tls_common.js b/lib/_tls_common.js index e02835c59b1e23..a9fe0d8f06aa0d 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -34,7 +34,7 @@ const { SSL_OP_CIPHER_SERVER_PREFERENCE } = process.binding('constants').crypto; // Lazily loaded var crypto = null; -const NativeSecureContext = process.binding('crypto').SecureContext; +const { SecureContext: NativeSecureContext } = process.binding('crypto'); function SecureContext(secureProtocol, secureOptions, context) { if (!(this instanceof SecureContext)) {