Skip to content

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Apr 17, 2025

abstract class Foo {
  accessor prop: number = 1;
  static accessor prop2: number = 1;
  accessor #prop3: number = 1;
  accessor [prop4]: number = 1;
  private accessor prop5: number = 1;
  abstract accessor prop6: number;
}

This case only has a #prop3 private field with an accessor. Since we haven't supported transforming accessor yet, the class_details.is_transform_required is always false in this class, which caused the private_field_count to be incorrect. Moving the decremental part to the pop side so that we can make sure the private_props_prop can always be handled correctly.

@Dunqing Dunqing requested a review from overlookmotel as a code owner April 17, 2025 08:43
@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-bug Category - Bug labels Apr 17, 2025
Copy link
Member Author

Dunqing commented Apr 17, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 17, 2025

CodSpeed Instrumentation Performance Report

Merging #10463 will not alter performance

Comparing 04-17-fix_transformer_class-properties_private_field_count_is_incorrect_when_class_only_have_accessor_with_private_field (45f8cc0) with main (b7e0536)

Summary

✅ 36 untouched benchmarks

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Apr 17, 2025
Copy link
Member

overlookmotel commented Apr 17, 2025

Merge activity

… when class only have `accessor` with private field (#10463)

```ts
abstract class Foo {
  accessor prop: number = 1;
  static accessor prop2: number = 1;
  accessor #prop3: number = 1;
  accessor [prop4]: number = 1;
  private accessor prop5: number = 1;
  abstract accessor prop6: number;
}
```
This case only has a `#prop3` private field with an accessor. Since we haven't supported transforming `accessor` yet, the `class_details.is_transform_required` is always `false` in this `class`, which caused the `private_field_count` to be incorrect. Moving the decremental part to the `pop` side so that we can make sure the `private_props_prop` can always be handled correctly.
@graphite-app graphite-app bot force-pushed the 04-17-fix_transformer_class-properties_private_field_count_is_incorrect_when_class_only_have_accessor_with_private_field branch from bf23a8a to 45f8cc0 Compare April 17, 2025 10:15
@graphite-app graphite-app bot merged commit 45f8cc0 into main Apr 17, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 04-17-fix_transformer_class-properties_private_field_count_is_incorrect_when_class_only_have_accessor_with_private_field branch April 17, 2025 10:21
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 17, 2025
graphite-app bot pushed a commit that referenced this pull request Apr 17, 2025
…g `private_field_count` (#10464)

Follow-on after #10463. Make this code a little clearer and add comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants