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;
|
||||
if (enableTrace === true)
|
||||
this[kEnableTrace] = true;
|
||||
else if (enableTrace === false || enableTrace == null)
|
||||
; // Tracing explicitly disabled, or defaulting to disabled.
|
||||
else
|
||||
if (typeof enableTrace === 'boolean') {
|
||||
this[kEnableTrace] = enableTrace;
|
||||
} else if (enableTrace != null) {
|
||||
throw new ERR_INVALID_ARG_TYPE(
|
||||
'options.enableTrace', 'boolean', enableTrace);
|
||||
}
|
||||
}
|
||||
|
||||
Object.setPrototypeOf(Server.prototype, net.Server.prototype);
|
||||
|
Loading…
x
Reference in New Issue
Block a user