fix(parser): forbid accessors named constructor#14017
fix(parser): forbid accessors named constructor#14017Boshen merged 1 commit intooxc-project:mainfrom
constructor#14017Conversation
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 fixes a parser issue by adding validation to forbid accessor properties named 'constructor' in classes. This addresses a specific parsing edge case where accessor properties with the name 'constructor' should be invalid according to JavaScript/TypeScript language rules.
- Adds validation to detect accessor properties named 'constructor' and report an error
- Introduces a new diagnostic error message for this specific case
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 check for 'constructor' named accessors and trigger error |
| crates/oxc_parser/src/diagnostics.rs | Defines new diagnostic error message for constructor accessor validation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #14017 will not alter performanceComparing Summary
|
|
He's back! |
Re-creation of #14015. Closes #14014.