feat(semantic): improve diagnostic for await in static block#20534
Conversation
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
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_awaitwith a more precise message. - Emit the new diagnostic for
ForOfStatementnodes withawaitinside 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. |
Merging this PR will not alter performance
Comparing Footnotes
|
await in static blockawait in static block
Merge activity
|
fe03b1b to
16e9a56
Compare
16e9a56 to
728fc8d
Compare

No description provided.