Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Aug 10, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 10, 2025 07:04
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 10, 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.

@github-actions github-actions bot added A-minifier Area - Minifier C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Aug 10, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the is_global_reference method in the GlobalContext trait by changing its return type from Option<bool> to bool, simplifying the API and eliminating the need to handle None cases throughout the codebase.

  • Changed GlobalContext::is_global_reference return type from Option<bool> to bool
  • Updated all implementations and call sites to use the simplified boolean return type
  • Added a new is_global_expr helper method to the GlobalContext trait
  • Consolidated duplicate GlobalReferenceInformation structs into a shared module definition

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/oxc_ecmascript/src/global_context.rs Updated trait definition and added is_global_expr helper method
crates/oxc_minifier/src/ctx.rs Updated implementation to return bool directly
crates/oxc_minifier/tests/ecmascript/value_type.rs Updated test implementation to return bool
crates/oxc_minifier/tests/ecmascript/may_have_side_effects.rs Updated test implementation to return bool
crates/oxc_minifier/tests/ecmascript/mod.rs Added shared GlobalReferenceInformation struct
crates/oxc_minifier/tests/ecmascript/to_string.rs Removed duplicate struct, uses shared implementation
crates/oxc_minifier/tests/ecmascript/to_number.rs Removed duplicate struct, uses shared implementation
crates/oxc_minifier/tests/ecmascript/to_boolean.rs Removed duplicate struct, uses shared implementation
crates/oxc_ecmascript/src/to_string.rs Simplified boolean check logic
crates/oxc_ecmascript/src/to_number.rs Simplified boolean check logic
crates/oxc_ecmascript/src/to_boolean.rs Simplified boolean check logic
crates/oxc_ecmascript/src/side_effects/may_have_side_effects.rs Updated to use new boolean return type
crates/oxc_ecmascript/src/constant_evaluation/value_type.rs Updated to use new boolean return and is_global_expr helper
crates/oxc_ecmascript/src/constant_evaluation/mod.rs Simplified boolean check logic
crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs Replaced custom validation with is_global_expr helper

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 10, 2025

CodSpeed Instrumentation Performance Report

Merging #12953 will not alter performance

Comparing 08-10-refactor_minifier_clean_up_is_global_reference_ (691e63a) with main (0c5bffc)

Summary

✅ 34 untouched benchmarks

@Boshen Boshen merged commit 8a5c9b9 into main Aug 10, 2025
30 checks passed
@Boshen Boshen deleted the 08-10-refactor_minifier_clean_up_is_global_reference_ branch August 10, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-minifier Area - Minifier C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants