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:
cjihrig committed 2019-05-02 12:37:41 -04:00
1 parent ee3b4fd5b2
commit b233d028b3
1 file changed
+4 -5
+4 -5
View File
@@ -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);