-
-
Notifications
You must be signed in to change notification settings - Fork 723
fix(parser): forbid acessors named constructor
#14015
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
fix(parser): forbid acessors named constructor
#14015
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. |
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 prevents class accessor properties from being named "constructor" by adding validation and appropriate error handling in the parser.
- Adds validation to check if accessor properties are named "constructor"
- Introduces a new diagnostic error for this invalid case
- Imports the
GetSpantrait needed for accessing the span information
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_parser/src/js/class.rs | Adds validation logic to forbid accessor properties named "constructor" |
| crates/oxc_parser/src/diagnostics.rs | Introduces new diagnostic error function for constructor accessor violations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Boshen
left a comment
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.
ts reports
"Classes may not have a field named 'constructor'.(18006)"
Boshen
left a comment
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.
ts reports
"Classes may not have a field named 'constructor'.(18006)"
CodSpeed Instrumentation Performance ReportMerging #14015 will not alter performanceComparing Summary
|
|
I accidentally committed changes from another branch onto this one... gonna re-create this PR |
Closes #14014