-
-
Notifications
You must be signed in to change notification settings - Fork 720
feat(minifier): new Date() has ValueType::Object
#12951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(minifier): new Date() has ValueType::Object
#12951
Conversation
Merge activity
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
There was a problem hiding this 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 implements value type determination for new Date() expressions in the JavaScript minifier, specifically recognizing that new Date() creates an object. The change enables better constant folding optimizations for Date constructor expressions.
- Adds support for
NewExpressionin the value type determination system - Implements specific handling for
new Date()to returnValueType::Object - Updates test expectations to reflect the improved minification of Date-related expressions
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_ecmascript/src/constant_evaluation/value_type.rs | Adds NewExpression support and Date constructor detection for value type determination |
| crates/oxc_minifier/src/peephole/fold_constants.rs | Updates test cases to expect optimized output for new Date() expressions |
CodSpeed Instrumentation Performance ReportMerging #12951 will not alter performanceComparing Summary
Footnotes |
1275418 to
53f7a9f
Compare

No description provided.