Skip to content

Comments

fix(minifier): omit dce undefined which can be a shadowed variable#4073

Merged
Boshen merged 1 commit intomainfrom
07-07-fix_minifier_omit_dce_undefined_which_can_be_a_shadowed_variable
Jul 6, 2024
Merged

fix(minifier): omit dce undefined which can be a shadowed variable#4073
Boshen merged 1 commit intomainfrom
07-07-fix_minifier_omit_dce_undefined_which_can_be_a_shadowed_variable

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Jul 6, 2024

 // Shadowed `undefined` as a variable should not be erased.
    test(
        "function foo(undefined) { if (!undefined) { } }",
        "function foo(undefined){if(!undefined){}}",
    );

I'm not using the cheap ident.reference_id.get().is_some() here yet because I don't know what I'm doing - how should minifier consume Semantic?

@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 6, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the A-minifier Area - Minifier label Jul 6, 2024
@Boshen
Copy link
Member Author

Boshen commented Jul 6, 2024

Passed tests in Rolldown.

@Boshen Boshen merged commit 719fb96 into main Jul 6, 2024
@Boshen Boshen deleted the 07-07-fix_minifier_omit_dce_undefined_which_can_be_a_shadowed_variable branch July 6, 2024 17:25
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 6, 2024

CodSpeed Performance Report

Merging #4073 will not alter performance

Comparing 07-07-fix_minifier_omit_dce_undefined_which_can_be_a_shadowed_variable (fd255e9) with main (adee728)

Summary

✅ 28 untouched benchmarks

@github-actions github-actions bot mentioned this pull request Jul 6, 2024
Boshen added a commit that referenced this pull request Jul 6, 2024
## [0.17.1] - 2024-07-06

### Bug Fixes

- aa585d3 ast_codegen, ast: Visit `ExpressionArrayElement` as
`Expression`. (#4061) (rzvxa)
- 564a75a codegen: Missing TypeParameters in TSConstructSignature
(#4063) (michaelm)
- adee728 isolated_declarations: Don't report an error for parameters if
they are ObjectPattern or ArrayPattern with an explicit type (#4065)
(michaelm)
- 1b8f208 isolated_declarations: Correct emit for private static methods
(#4064) (michaelm)
- 719fb96 minifier: Omit dce `undefined` which can be a shadowed
variable (#4073) (Boshen)
- 150f4d9 napi/transform: Display error with spanned messages (Boshen)

### Performance

- 7fe2a2f parser: Do not copy comments (#4067) (overlookmotel)

### Refactor

- 8fa98e0 ast: Inline trivial functions and shorten code (#4066)
(overlookmotel)
- 65aee19 isolated-declarations: Reorganize scope tree (#4070) (Luca
Bruno)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-minifier Area - Minifier

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant