oxc/crates
Dunqing 0d0bb17ad9 feat(transformer): complete the async-to-generator plugin (#6658)
In this PR, most of the async functions have transformed correctly. But the async arrow functions don't fully transform correctly yet, it is related to we need to transform the arrow function to the generator function. For example:

Input:
```js
function declaration() {
  const asy = async () => {
  console.log(this.name)
 }
}
```

Output:
```js
function declaration() {
  const asy = babelHelpers.asyncToGenerator(function* () {
     console.log(this.name);
  });
}
```

Expected Output:

```js
function declaration() {
  var _this = this;
  const asy = /*#__PURE__*/function () {
    var _ref = babelHelpers.asyncToGenerator(function* () {
      console.log(_this.name);
    });
    return function asy() {
      return _ref.apply(this, arguments);
    };
  }();
}
```

From the expected output, we haven't handled `this` correctly, which means even if the `arrow-function` plugin doesn't enable, we still need to handle this correctly as the `arrow-function` plugin does, and further question if `arrow-function` plugin is enabled, how to avoid these making conflict?

I thought we may move out the implementation of `arrow-function` and as a common helper, this way every plugin can handle this well
2024-10-25 03:23:31 +00:00
..
oxc fix(types): Change @oxc/types package name (#6874) 2024-10-24 20:04:09 +00:00
oxc_allocator release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_ast feat(transformer): complete the async-to-generator plugin (#6658) 2024-10-25 03:23:31 +00:00
oxc_ast_macros release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_cfg release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_codegen refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_data_structures release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_diagnostics release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_ecmascript feat(minifier): implement folding substring string fns (#6869) 2024-10-25 01:29:56 +00:00
oxc_estree release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_index refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_isolated_declarations refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_language_server fix(oxc_language_server): correct diagnostic link (#6765) 2024-10-22 06:23:54 -04:00
oxc_linter feat(regular_expression)!: Support ES2025 Duplicated named capture groups (#6847) 2024-10-25 02:13:57 +00:00
oxc_macros refactor(linter): add run_on_jest_node to run rules on only jest nodes (#6721) 2024-10-21 02:13:58 +00:00
oxc_mangler release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_minifier feat(minifier): implement folding String.prototype.replaceAll (#6871) 2024-10-25 01:29:57 +00:00
oxc_module_lexer refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_parser refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_prettier refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_regular_expression feat(regular_expression)!: Support ES2025 Duplicated named capture groups (#6847) 2024-10-25 02:13:57 +00:00
oxc_semantic refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_sourcemap release(crates): v0.33.0 (#6843) 2024-10-24 10:29:22 +08:00
oxc_span refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_syntax refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_transformer feat(transformer): complete the async-to-generator plugin (#6658) 2024-10-25 03:23:31 +00:00
oxc_traverse refactor(rust): remove the annoying clippy::wildcard_imports (#6860) 2024-10-24 13:57:19 +00:00
oxc_wasm fix(types): Change @oxc/types package name (#6874) 2024-10-24 20:04:09 +00:00