Skip to content

fix(parser): set the correct context for class property initializer#10859

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-07-fix_parser_set_the_correct_context_for_class_property_definition
May 7, 2025
Merged

fix(parser): set the correct context for class property initializer#10859
graphite-app[bot] merged 1 commit intomainfrom
05-07-fix_parser_set_the_correct_context_for_class_property_definition

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented May 7, 2025

fixes #10840

class C {
  p = await(0);
}

FieldDefinition[Yield, Await] :
  ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt

Copilot AI review requested due to automatic review settings May 7, 2025 13:07
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 pull request fixes the context handling for class property initializers in the parser and adds a corresponding test case for TypeScript syntax.

  • Update the parser to use the correct context when parsing class property initializers
  • Add an integration test case for the updated class property syntax in TypeScript

Reviewed Changes

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

File Description
crates/oxc_parser/src/js/class.rs Adjusts the initializer parsing to set proper context flags (In, Yield, Await)
crates/oxc_codegen/tests/integration/ts.rs Adds a new test case to validate the class property syntax with await

@github-actions github-actions bot added A-parser Area - Parser A-codegen Area - Code Generation labels May 7, 2025
Copy link
Member Author

Boshen commented May 7, 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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-bug Category - Bug label May 7, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented May 7, 2025

Merge activity

…10859)

fixes #10840

```
class C {
  p = await(0);
}

FieldDefinition[Yield, Await] :
  ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt
```
@graphite-app graphite-app bot force-pushed the 05-07-fix_parser_set_the_correct_context_for_class_property_definition branch from 51d2413 to 087af52 Compare May 7, 2025 13:18
@codspeed-hq
Copy link

codspeed-hq bot commented May 7, 2025

CodSpeed Instrumentation Performance Report

Merging #10859 will not alter performance

Comparing 05-07-fix_parser_set_the_correct_context_for_class_property_definition (087af52) with main (daba0a7)

Summary

✅ 36 untouched benchmarks

@Boshen Boshen changed the title fix(parser): set the correct context for class property definition fix(parser): set the correct context for class property initializer May 7, 2025
@graphite-app graphite-app bot merged commit 087af52 into main May 7, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 05-07-fix_parser_set_the_correct_context_for_class_property_definition branch May 7, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegen Area - Code Generation A-parser Area - Parser C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

await with parenthesis should be CallExpression in body class

2 participants