Skip to content

Commit c82010d

Browse files
committed
[Squash] use kHandle
1 parent 4ca0e4c commit c82010d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/_tls_wrap.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const kErrorEmitted = Symbol('error-emitted');
5656
const kHandshakeTimeout = Symbol('handshake-timeout');
5757
const kRes = Symbol('res');
5858
const kSNICallback = Symbol('snicallback');
59-
const kSSL = Symbol('ssl');
59+
const kHandle = Symbol('ssl');
6060

6161
const noop = () => {};
6262

@@ -326,14 +326,14 @@ function TLSSocket(socket, opts) {
326326
});
327327

328328
// Proxy for API compatibility
329-
this[kSSL] = this._handle;
329+
this[kHandle] = this._handle;
330330
Object.defineProperty(this, 'ssl', {
331331
enumerable: true,
332332
configurable: true,
333-
get: util.deprecate(() => this[kSSL],
333+
get: util.deprecate(() => this[kHandle],
334334
'The tlsSocket.ssl property is deprecated.',
335335
'DEP00XX'),
336-
set: util.deprecate((val) => this[kSSL] = val,
336+
set: util.deprecate((val) => this[kHandle] = val,
337337
'The tlsSocket.ssl property is deprecated.',
338338
'DEP00XX')
339339
});
@@ -377,8 +377,8 @@ for (var n = 0; n < proxiedMethods.length; n++) {
377377
tls_wrap.TLSWrap.prototype.close = function close(cb) {
378378
let ssl;
379379
if (this[owner_symbol]) {
380-
ssl = this[owner_symbol][kSSL];
381-
this[owner_symbol][kSSL] = null;
380+
ssl = this[owner_symbol][kHandle];
381+
this[owner_symbol][kHandle] = null;
382382
}
383383

384384
// Invoke `destroySSL` on close to clean up possibly pending write requests
@@ -468,13 +468,13 @@ function destroySSL(self) {
468468
}
469469

470470
TLSSocket.prototype._destroySSL = function _destroySSL() {
471-
if (!this[kSSL]) return;
472-
this[kSSL].destroySSL();
473-
if (this[kSSL]._secureContext.singleUse) {
474-
this[kSSL]._secureContext.context.close();
475-
this[kSSL]._secureContext.context = null;
471+
if (!this[kHandle]) return;
472+
this[kHandle].destroySSL();
473+
if (this[kHandle]._secureContext.singleUse) {
474+
this[kHandle]._secureContext.context.close();
475+
this[kHandle]._secureContext.context = null;
476476
}
477-
this[kSSL] = null;
477+
this[kHandle] = null;
478478
};
479479

480480
TLSSocket.prototype._init = function(socket, wrap) {

0 commit comments

Comments
 (0)