fix(parser): produce syntax error for ({}) = x when preserveParens:false#11263
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the parser to produce a syntax error when an object or array pattern is used as the left-hand side of an assignment and is parenthesized (e.g., "({}) = x;"). Key changes include capturing the parenthesized state and span of the left-hand side expression, propagating this information to the assignment expression parsing, and performing a new error check based on the captured span.
Comments suppressed due to low confidence (1)
crates/oxc_parser/src/js/expression.rs:1324
- [nitpick] Consider using consistent naming for the parenthesized span variable. The variable 'lhs_parenthesized_span' is defined earlier but the function parameter is named 'left_parenthesized_span'.
left_parenthesized_span: Option<Span>,
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. |
CodSpeed Instrumentation Performance ReportMerging #11263 will degrade performances by 13.1%Comparing Summary
Benchmarks breakdown
|
Merge activity
|
1c0ffb8 to
aa510cf
Compare

closes #10899