GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tls: use optional chaining to simplify checks by aduh95 · Pull Request #41337 · nodejs/node

Conversation

@aduh95

@aduh95 aduh95 commented Dec 27, 2021

Copy link
Copy Markdown
Contributor

Refs: #41170 (review)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@aduh95
tls: use optional chaining to simplify checks
403efa1
@nodejs-github-bot 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
tniessen
tniessen approved these changes Dec 27, 2021
View reviewed changes
@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Dec 27, 2021
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 27, 2021
@nodejs-github-bot

nodejs-github-bot commented Dec 27, 2021

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/41671/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott added the dont-land-on-v12.x label Dec 27, 2021
sindresorhus
sindresorhus reviewed Dec 27, 2021
View reviewed changes
Comment thread lib/internal/tls/secure-context.js
const pem = (
val !== undefined && val !== null &&
val.pem !== undefined ? val.pem : val);
val?.pem !== undefined ? val.pem : val);

@sindresorhus sindresorhus Dec 27, 2021

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
val?.pem !== undefined ? val.pem : val);
val?.pem ?? val);

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@aduh95 aduh95 Dec 27, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What if val.pem is null?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lpinca reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@fhinkel fhinkel Dec 28, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fhinkel
fhinkel approved these changes Dec 28, 2021
View reviewed changes
This was referenced Dec 30, 2021
CI Reliability 2021-12-30 nodejs/reliability#160
Open
CI Reliability 2021-12-31 nodejs/reliability#161
Open
CI Reliability 2022-01-01 nodejs/reliability#162
Open
CI Reliability 2022-01-02 nodejs/reliability#163
Open
CI Reliability 2022-01-03 nodejs/reliability#164
Open
CI Reliability 2022-01-04 nodejs/reliability#165
Open
CI Reliability 2022-01-05 nodejs/reliability#166
Open
@nodejs-github-bot

nodejs-github-bot commented Jan 5, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/41760/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added the commit-queue PRs queued for automated landing through the Commit Queue. label Jan 5, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jan 5, 2022
@nodejs-github-bot
nodejs-github-bot merged commit f34c0e0 into nodejs:master Jan 5, 2022
@nodejs-github-bot

nodejs-github-bot commented Jan 5, 2022

Copy link
Copy Markdown
Collaborator

Landed in f34c0e0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95
aduh95 deleted the tls-optional-chaining branch January 5, 2022 14:25
This was referenced Jan 6, 2022
CI Reliability 2022-01-06 nodejs/reliability#167
Open
CI Reliability 2022-01-07 nodejs/reliability#168
Open
CI Reliability 2022-01-08 nodejs/reliability#169
Open
CI Reliability 2022-01-09 nodejs/reliability#170
Open
targos pushed a commit that referenced this pull request Jan 14, 2022
@aduh95 @targos
tls: use optional chaining to simplify checks
3c8b25b
PR-URL: #41337
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
@targos targos mentioned this pull request Jan 16, 2022
v17.4.0 release proposal #41557
Merged
danielleadams pushed a commit that referenced this pull request Jan 31, 2022
@aduh95 @danielleadams
tls: use optional chaining to simplify checks
2ca8438
PR-URL: #41337
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
@aduh95 @danielleadams
tls: use optional chaining to simplify checks
00abb81
PR-URL: #41337
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
@danielleadams danielleadams mentioned this pull request Feb 1, 2022
v16.14.0 proposal #41804
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tniessen tniessen tniessen approved these changes
+2 more reviewers
@sindresorhus sindresorhus sindresorhus left review comments
@fhinkel fhinkel fhinkel approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@aduh95 @nodejs-github-bot @fhinkel @sindresorhus @tniessen @Trott
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.