Skip to content

Make more use of optional chaining. NFC #23521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 28, 2025

I found all these sites using:

$ git grep -n "if (\(.*\) && \1\>.*)" src/

@sbc100 sbc100 requested a review from dschuff January 28, 2025 23:51
@sbc100 sbc100 force-pushed the optional_chainging branch from a5e7da8 to d00ce86 Compare January 29, 2025 00:11
@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 29, 2025

Reverted the non-NFC part

I found all these sites using:

```
$ git grep -n "if (\(.*\) && \1\>.*)" src/
```
@sbc100 sbc100 force-pushed the optional_chainging branch from d00ce86 to 3e72205 Compare January 29, 2025 01:20
@sbc100 sbc100 enabled auto-merge (squash) January 29, 2025 01:21
@sbc100 sbc100 merged commit 5a327e9 into emscripten-core:main Jan 29, 2025
29 checks passed
@sbc100 sbc100 deleted the optional_chainging branch January 29, 2025 02:28
@@ -1184,7 +1184,7 @@ for (/**@suppress{duplicate}*/var i = 0; i <= {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
}
// Make sure the canvas object no longer refers to the context object so
// there are no GC surprises.
if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) {
if (GL.contexts[contextHandle]?.GLctx?.canvas) {
Copy link
Member

Choose a reason for hiding this comment

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

The second ? was not needed before so I assume it isn't after either?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I'll try reverting that.

sbc100 added a commit to sbc100/emscripten that referenced this pull request Jan 29, 2025
sbc100 added a commit that referenced this pull request Jan 29, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants