feat(parser): produce syntax error for ({ foo(bar) })#17267
feat(parser): produce syntax error for ({ foo(bar) })#17267graphite-app[bot] merged 1 commit intomainfrom
({ foo(bar) })#17267Conversation
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 adds proper syntax error detection for object methods without function bodies in the pattern ({ foo(bar) }), addressing issue #17265.
- Updated parser logic to require function bodies for object methods even in TypeScript mode
- Improved error reporting for missing function bodies in object literal methods and accessors
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/oxc_parser/src/js/function.rs |
Modified condition to enforce function body requirement for object methods regardless of TypeScript mode |
tasks/coverage/snapshots/parser_typescript.snap |
Updated test snapshots to reflect new error messages and passing test for objectLiteralMemberWithoutBlock1.ts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17267 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
79f3a09 to
4ac23e1
Compare

closes #17265