Skip to content

Turbopack analyzer: analyze ternaries + promises in string & nullish methods#94187

Merged
sampoder merged 1 commit into
canaryfrom
sp/turbopack_analyzer_tenary
May 29, 2026
Merged

Turbopack analyzer: analyze ternaries + promises in string & nullish methods#94187
sampoder merged 1 commit into
canaryfrom
sp/turbopack_analyzer_tenary

Conversation

@sampoder
Copy link
Copy Markdown
Member

@sampoder sampoder commented May 28, 2026

If in a ternary, we have x ? y : z and both y and z are null-ish, then this expression is null-ish. This is also true for if they are both strings, empty strings, or truthy. This PR adds this to the Turbopack analyzer and adds unit tests that cover these cases as well. It is stacked on top of another PR that set up the structure for these unit tests.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Stats skipped

Commit: 4447ecf
View workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Tests Passed

Commit: 4447ecf

@sampoder sampoder changed the title sp/turbopack analyzer tenary Turbopack analyzer: analyze ternaries in string & nullish methods May 28, 2026
@sampoder sampoder marked this pull request as ready for review May 28, 2026 08:12
Base automatically changed from sp/turbopack_analyzer_promises to canary May 28, 2026 19:41
@sampoder sampoder force-pushed the sp/turbopack_analyzer_tenary branch 2 times, most recently from 11690e0 to 87432ad Compare May 29, 2026 20:40
@sampoder sampoder force-pushed the sp/turbopack_analyzer_tenary branch from 87432ad to 4447ecf Compare May 29, 2026 23:18
@sampoder sampoder changed the title Turbopack analyzer: analyze ternaries in string & nullish methods Turbopack analyzer: analyze ternaries + promises in string & nullish methods May 29, 2026
@sampoder sampoder merged commit 3aaf5da into canary May 29, 2026
162 of 164 checks passed
@sampoder sampoder deleted the sp/turbopack_analyzer_tenary branch May 29, 2026 23:49
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.

2 participants