Skip to content

Commit 576fe33

Browse files
cjihrigtargos
authored andcommitted
tls: simplify enableTrace logic
PR-URL: #27497 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 29e2793 commit 576fe33

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/_tls_wrap.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -998,13 +998,12 @@ function Server(options, listener) {
998998
}
999999

10001000
const enableTrace = options.enableTrace;
1001-
if (enableTrace === true)
1002-
this[kEnableTrace] = true;
1003-
else if (enableTrace === false || enableTrace == null)
1004-
; // Tracing explicitly disabled, or defaulting to disabled.
1005-
else
1001+
if (typeof enableTrace === 'boolean') {
1002+
this[kEnableTrace] = enableTrace;
1003+
} else if (enableTrace != null) {
10061004
throw new ERR_INVALID_ARG_TYPE(
10071005
'options.enableTrace', 'boolean', enableTrace);
1006+
}
10081007
}
10091008

10101009
Object.setPrototypeOf(Server.prototype, net.Server.prototype);

0 commit comments

Comments
 (0)