refactor(parser): refactor parse member expression#10880
refactor(parser): refactor parse member expression#10880graphite-app[bot] merged 1 commit intomainfrom
Conversation
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.
Pull Request Overview
This PR refactors how member expressions are parsed, adding improved handling for optional chains and decorators. Key changes include:
- Adding a decorator check in optional chaining that triggers a clear error message.
- Refactoring the parse_member_expression_rest function to accept an additional allow_optional_chain parameter.
- Adjusting the call paths for static, computed, and tagged template expressions alongside enhanced error handling.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_parser/src/js/expression.rs | Updates to member expression parsing logic to better support decorators and optional chain syntax |
| crates/oxc_parser/src/diagnostics.rs | New diagnostic functions for decorator usage and invalid optional chains |
Comments suppressed due to low confidence (3)
crates/oxc_parser/src/js/expression.rs:872
- [nitpick] Verify that the error produced for an optional chain in a new expression (using diagnostics::invalid_new_optional_chain) is consistent with project conventions and accurately reflects the parsing rules.
if self.at(Kind::QuestionDot) {
crates/oxc_parser/src/js/expression.rs:658
- Double-check that the decorator check here correctly captures all cases where an expression used as a decorator should be parenthesized. Ensure that this error diagnostic aligns with similar parser error handling in related contexts.
if self.ctx.has_decorator() {
crates/oxc_parser/src/js/expression.rs:797
- Review the control flow change introduced by the explicit return within parse_member_expression_rest to ensure it correctly exits the loop as intended without bypassing additional parsing steps.
return lhs;
Merge activity
|
CodSpeed Instrumentation Performance ReportMerging #10880 will not alter performanceComparing Summary
|
c2d0971 to
d5cd29d
Compare

closes #10615