Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(transformer/arrow-functions): store super_methods on a Stack to fix nested async methods #8331

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Jan 8, 2025

In the following case, async methods can be nested in another async method. The implementation is changing to store super_methods on a stack, and then we can store super method information in the correct super_methods map.

const outer = {
  value: 0,
  async method() {
    () => super.value;

    const inner = {
      value: 0,
      async method() {
        () => super.value;
      }
    };

    () => super.value;
  }
};

@Dunqing Dunqing requested a review from overlookmotel as a code owner January 8, 2025 04:15
@Dunqing Dunqing changed the title fix(transformer/arrow-functions): store super_methods to Stack to fix nested async methods fix(transformer/arrow-functions): store super_methods to Stack to fix nested async methods Jan 8, 2025
@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-bug Category - Bug labels Jan 8, 2025
Copy link
Member Author

Dunqing commented Jan 8, 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.

Copy link

codspeed-hq bot commented Jan 8, 2025

CodSpeed Performance Report

Merging #8331 will not alter performance

Comparing 01-08-fix_transformer_arrow-functions_store_super_methods_to_stack_to_fix_nested_async_methods (e4d66e4) with main (e0a09ab)

Summary

✅ 29 untouched benchmarks

@Dunqing Dunqing changed the title fix(transformer/arrow-functions): store super_methods to Stack to fix nested async methods fix(transformer/arrow-functions): store super_methods on a Stack to fix nested async methods Jan 8, 2025
@Dunqing Dunqing force-pushed the 01-08-fix_transformer_arrow-functions_store_super_methods_to_stack_to_fix_nested_async_methods branch from 63f91ae to 2788e89 Compare January 8, 2025 07:43
@Dunqing Dunqing force-pushed the 01-08-fix_transformer_arrow-functions_store_super_methods_to_stack_to_fix_nested_async_methods branch from 2788e89 to 571a23e Compare January 8, 2025 08:29
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jan 8, 2025
Copy link
Contributor

overlookmotel commented Jan 8, 2025

Merge activity

  • Jan 8, 4:00 PM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 8, 4:00 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 8, 4:05 PM EST: A user merged this pull request with the Graphite merge queue.

…to fix nested async methods (#8331)

In the following case, async methods can be nested in another async method. The implementation is changing to store `super_methods` on a stack, and then we can store super method information in the correct `super_methods` map.

```js
const outer = {
  value: 0,
  async method() {
    () => super.value;

    const inner = {
      value: 0,
      async method() {
        () => super.value;
      }
    };

    () => super.value;
  }
};
```
@overlookmotel overlookmotel force-pushed the 01-08-fix_transformer_arrow-functions_store_super_methods_to_stack_to_fix_nested_async_methods branch from 571a23e to e4d66e4 Compare January 8, 2025 21:00
@graphite-app graphite-app bot merged commit e4d66e4 into main Jan 8, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 01-08-fix_transformer_arrow-functions_store_super_methods_to_stack_to_fix_nested_async_methods branch January 8, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-transformer Area - Transformer / Transpiler C-bug Category - Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants