Skip to content

Commit

Permalink
tls: simplify enableTrace logic
Browse files Browse the repository at this point in the history
PR-URL: #27497
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
cjihrig authored and targos committed May 4, 2019
1 parent 29e2793 commit 576fe33
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 576fe33

Please sign in to comment.