Skip to content

feat(minifier): compress typeof a.b === 'undefined' to a.b === void 0#8751

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-27-feat_minifier_compress_typeof_a.b_undefined_to_a.b_void_0_
Jan 27, 2025
Merged

feat(minifier): compress typeof a.b === 'undefined' to a.b === void 0#8751
graphite-app[bot] merged 1 commit intomainfrom
01-27-feat_minifier_compress_typeof_a.b_undefined_to_a.b_void_0_

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Jan 27, 2025

The special behavior of typeof is only for the identifier, so it should be safe to compress typeof a.b === 'undefined' (and other expressions) to a.b === void 0.

Copy link
Member Author

sapphi-red commented Jan 27, 2025


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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 27, 2025

CodSpeed Performance Report

Merging #8751 will not alter performance

Comparing 01-27-feat_minifier_compress_typeof_a.b_undefined_to_a.b_void_0_ (ad14403) with main (a3b078a)

Summary

✅ 33 untouched benchmarks

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jan 27, 2025
Copy link
Member

Boshen commented Jan 27, 2025

Merge activity

  • Jan 27, 9:25 AM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 27, 9:25 AM EST: A user added this pull request to the Graphite merge queue.
  • Jan 27, 9:46 AM EST: A user merged this pull request with the Graphite merge queue.

…d 0` (#8751)

The special behavior of `typeof` is only for the identifier, so it should be safe to compress `typeof a.b === 'undefined'` (and other expressions) to `a.b === void 0`.
@Boshen Boshen force-pushed the 01-27-feat_minifier_compress_a_null_b_to_a_b_when_return_value_is_ignored branch from 2ff3de0 to f7f2d2f Compare January 27, 2025 14:31
@Boshen Boshen force-pushed the 01-27-feat_minifier_compress_typeof_a.b_undefined_to_a.b_void_0_ branch from f6342d1 to ad14403 Compare January 27, 2025 14:32
Base automatically changed from 01-27-feat_minifier_compress_a_null_b_to_a_b_when_return_value_is_ignored to main January 27, 2025 14:42
@graphite-app graphite-app bot merged commit ad14403 into main Jan 27, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 01-27-feat_minifier_compress_typeof_a.b_undefined_to_a.b_void_0_ branch January 27, 2025 14:46
@oxc-bot oxc-bot mentioned this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-minifier Area - Minifier C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants