Skip to content

fix(semantic): report error on await inside block inside static block#20750

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/03-25-fix_parser_report_error_on_await_inside_block_inside_static_block
Mar 26, 2026
Merged

fix(semantic): report error on await inside block inside static block#20750
graphite-app[bot] merged 1 commit intomainfrom
c/03-25-fix_parser_report_error_on_await_inside_block_inside_static_block

Conversation

@camc314
Copy link
Copy Markdown
Contributor

@camc314 camc314 commented Mar 25, 2026

No description provided.

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

camc314 commented Mar 25, 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.

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

This PR ensures await inside a nested {} block within a class static { ... } initialization block is correctly reported as an error during semantic checking, and updates coverage artifacts accordingly.

Changes:

  • Update check_await_expression to detect being inside a class static block via ancestor scope traversal (not just the current scope).
  • Add a new negative coverage fixture for await inside a nested block within a class static block.
  • Update the parser_misc snapshot to include the new expected diagnostic and increment negative test counts.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
tasks/coverage/snapshots/parser_misc.snap Adds expected diagnostic output for the new negative case and updates summary counts.
tasks/coverage/misc/fail/await-expr-in-block-in-class-static-block.mjs New negative fixture exercising await in a nested block inside static {}.
crates/oxc_semantic/src/checker/javascript.rs Makes class-static-block detection robust for await by walking scope ancestors.

@camc314 camc314 force-pushed the c/03-25-fix_parser_report_error_on_await_inside_block_inside_static_block branch from 081f24e to a803813 Compare March 25, 2026 20:57
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 25, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing c/03-25-fix_parser_report_error_on_await_inside_block_inside_static_block (aa0f825) with main (ccf9301)

Open in CodSpeed

Footnotes

  1. 8 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 fix(parser): report error on await inside block inside static block fix(semantic): report error on await inside block inside static block Mar 26, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 26, 2026
Copy link
Copy Markdown
Contributor Author

camc314 commented Mar 26, 2026

Merge activity

  • Mar 26, 1:58 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 26, 2:00 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 26, 2:07 PM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.
  • Mar 26, 2:09 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 26, 2:16 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 26, 2:21 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot changed the base branch from c/03-25-fix_parser_report_error_on_for-await_inside_block_inside_static_block to graphite-base/20750 March 26, 2026 13:59
@graphite-app graphite-app bot changed the base branch from graphite-base/20750 to main March 26, 2026 14:06
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 26, 2026
@camc314 camc314 force-pushed the c/03-25-fix_parser_report_error_on_await_inside_block_inside_static_block branch from a803813 to aa0f825 Compare March 26, 2026 14:09
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 26, 2026
@graphite-app graphite-app bot force-pushed the c/03-25-fix_parser_report_error_on_await_inside_block_inside_static_block branch from aa0f825 to ffacf99 Compare March 26, 2026 14:17
@graphite-app graphite-app bot merged commit ffacf99 into main Mar 26, 2026
26 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 26, 2026
@graphite-app graphite-app bot deleted the c/03-25-fix_parser_report_error_on_await_inside_block_inside_static_block branch March 26, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants