fix(parser): forbid acessors named constructor#14015
fix(parser): forbid acessors named constructor#14015DonIsaac wants to merge 4 commits intooxc-project:mainfrom
constructor#14015Conversation
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.
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.
ts reports
"Classes may not have a field named 'constructor'.(18006)"
Boshen
left a comment
There was a problem hiding this comment.
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