tls: simplify enableTrace logic
PR-URL: https://github.com/nodejs/node/pull/27497 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
ee3b4fd5b2
commit
b233d028b3
@ -998,13 +998,12 @@ function Server(options, listener) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const enableTrace = options.enableTrace;
|
const enableTrace = options.enableTrace;
|
||||||
if (enableTrace === true)
|
if (typeof enableTrace === 'boolean') {
|
||||||
this[kEnableTrace] = true;
|
this[kEnableTrace] = enableTrace;
|
||||||
else if (enableTrace === false || enableTrace == null)
|
} else if (enableTrace != null) {
|
||||||
; // Tracing explicitly disabled, or defaulting to disabled.
|
|
||||||
else
|
|
||||||
throw new ERR_INVALID_ARG_TYPE(
|
throw new ERR_INVALID_ARG_TYPE(
|
||||||
'options.enableTrace', 'boolean', enableTrace);
|
'options.enableTrace', 'boolean', enableTrace);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.setPrototypeOf(Server.prototype, net.Server.prototype);
|
Object.setPrototypeOf(Server.prototype, net.Server.prototype);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user