Skip to content

feat(semantic): improve diagnostic for await in static block#20534

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/03-19-feat_parser_improve_diagnostic_for_await_in_static_block
Mar 19, 2026
Merged

feat(semantic): improve diagnostic for await in static block#20534
graphite-app[bot] merged 1 commit intomainfrom
c/03-19-feat_parser_improve_diagnostic_for_await_in_static_block

Conversation

@camc314
Copy link
Copy Markdown
Contributor

@camc314 camc314 commented Mar 19, 2026

No description provided.

@camc314 camc314 marked this pull request as ready for review March 19, 2026 21:13
@camc314 camc314 requested a review from Dunqing as a code owner March 19, 2026 21:13
Copilot AI review requested due to automatic review settings March 19, 2026 21:14
Copy link
Copy Markdown
Contributor Author

camc314 commented Mar 19, 2026


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 changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added A-semantic Area - Semantic C-enhancement Category - New feature or request labels Mar 19, 2026
@camc314 camc314 self-assigned this Mar 19, 2026
Copy link
Copy Markdown
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

Improves the semantic diagnostic emitted when a for await (...) loop appears inside a class static initialization block, making the error message more specific and updating coverage snapshots accordingly.

Changes:

  • Add a dedicated diagnostic class_static_block_for_await with a more precise message.
  • Emit the new diagnostic for ForOfStatement nodes with await inside class static blocks.
  • Update TypeScript parser coverage snapshots to reflect the new wording.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
tasks/coverage/snapshots/parser_typescript.snap Updates expected snapshot output for for await in class static blocks.
crates/oxc_semantic/src/diagnostics.rs Adds a new diagnostic function for the for await case.
crates/oxc_semantic/src/checker/javascript.rs Switches for await in static blocks to use the new diagnostic.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 19, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing c/03-19-feat_parser_improve_diagnostic_for_await_in_static_block (728fc8d) with main (f9a63ca)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@camc314 camc314 changed the title feat(parser): improve diagnostic for await in static block feat(semantic): improve diagnostic for await in static block Mar 19, 2026
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Mar 19, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the c/03-19-feat_parser_improve_diagnostic_for_await_in_static_block branch from fe03b1b to 16e9a56 Compare March 19, 2026 21:42
@graphite-app graphite-app bot force-pushed the c/03-19-feat_parser_improve_diagnostic_for_await_in_static_block branch from 16e9a56 to 728fc8d Compare March 19, 2026 21:44
@graphite-app graphite-app bot merged commit 728fc8d into main Mar 19, 2026
30 checks passed
@graphite-app graphite-app bot deleted the c/03-19-feat_parser_improve_diagnostic_for_await_in_static_block branch March 19, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants