Skip to content

feat(minifier): remove unnecessary "use strict"#8154

Closed
sapphi-red wants to merge 2 commits intooxc-project:mainfrom
sapphi-red:feat/remove-unnecessary-use-strict-directive
Closed

feat(minifier): remove unnecessary "use strict"#8154
sapphi-red wants to merge 2 commits intooxc-project:mainfrom
sapphi-red:feat/remove-unnecessary-use-strict-directive

Conversation

@sapphi-red
Copy link
Member

No description provided.

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 28, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Dec 28, 2024
@sapphi-red sapphi-red marked this pull request as draft December 28, 2024 06:30
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 28, 2024

CodSpeed Performance Report

Merging #8154 will not alter performance

Comparing sapphi-red:feat/remove-unnecessary-use-strict-directive (4c0a41b) with main (37c9959)

Summary

✅ 29 untouched benchmarks

@sapphi-red sapphi-red marked this pull request as ready for review December 28, 2024 07:24
Comment on lines +131 to +139
/// Drop `"use strict";` directives if the function is empty.
fn drop_use_strict_directives_if_function_is_empty(
body: &mut FunctionBody<'a>,
_ctx: &mut TraverseCtx<'a>,
) {
if body.statements.is_empty() {
body.directives.retain(|directive| !directive.is_use_strict());
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if it makes sense to exist in PeepholeRemoveDeadCode. This has to run after everything that might remove statements.

@sapphi-red
Copy link
Member Author

=> #8173

@sapphi-red sapphi-red closed this Dec 29, 2024
@sapphi-red sapphi-red deleted the feat/remove-unnecessary-use-strict-directive branch December 29, 2024 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-minifier Area - Minifier C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant