FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tls: use optional chaining to simplify checks by aduh95 · Pull Request #41337 · nodejs/node · GitHub

/ node Public

tls: use optional chaining to simplify checks - #41337

Merged
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
aduh95:tls-optional-chaining
Jan 5, 2022
Merged

tls: use optional chaining to simplify checks#41337
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
aduh95:tls-optional-chaining

Conversation

aduh95 commented Dec 27, 2021

Copy link
Copy Markdown
Contributor

nodejs-github-bot added needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem. labels Dec 27, 2021
aduh95 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 27, 2021
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 27, 2021

Copy link
Copy Markdown
Collaborator

const pem = (
val !== undefined && val !== null &&
val.pem !== undefined ? val.pem : val);
val?.pem !== undefined ? val.pem : val);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
val?.pem !== undefined ? val.pem : val);
val?.pem ?? val);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What if val.pem is null?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Using ?? would change the current behavior. If we want to keep this a refactoring, we can't use ??. Now, if we know that val.pem can never be null, we can make that change safely - but maybe in a separate commit?

Copy link
Copy Markdown
Collaborator

aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 5, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 5, 2022
nodejs-github-bot merged commit f34c0e0 into nodejs:master Jan 5, 2022

Copy link
Copy Markdown
Collaborator

Landed in f34c0e0

aduh95 deleted the tls-optional-chaining branch January 5, 2022 14:25
targos pushed a commit that referenced this pull request Jan 14, 2022
PR-URL: #41337
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
PR-URL: #41337
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
PR-URL: #41337
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
danielleadams mentioned this pull request Feb 1, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL