Skip to content

Conversation

@DonIsaac
Copy link
Contributor

Closes #14014

Copilot AI review requested due to automatic review settings September 23, 2025 01:42
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 23, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-parser Area - Parser C-bug Category - Bug labels Sep 23, 2025
Copy link
Contributor

Copilot AI left a 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 GetSpan trait 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.

Copy link
Member

@Boshen Boshen left a 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)"

Copy link
Member

@Boshen Boshen left a 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-hq
Copy link

codspeed-hq bot commented Sep 23, 2025

CodSpeed Instrumentation Performance Report

Merging #14015 will not alter performance

Comparing DonIsaac:don/parser/fix/accessor-constructor (52be6af) with main (36ac0fb)

Summary

✅ 37 untouched

@DonIsaac DonIsaac requested a review from camc314 as a code owner September 23, 2025 02:59
@github-actions github-actions bot added the A-linter Area - Linter label Sep 23, 2025
@DonIsaac
Copy link
Contributor Author

I accidentally committed changes from another branch onto this one... gonna re-create this PR

@DonIsaac DonIsaac closed this Sep 23, 2025
Boshen pushed a commit that referenced this pull request Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter A-parser Area - Parser C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forbid accessor named constructor

2 participants