angular/packages/compiler-cli
Paul Gschwendtner 6c1573bc08 fix(compiler-cli): downlevel transform incorrectly extracting constructor parameters for nested classes (#44281)
The downlevel decorator transform (commonly used in the CLI and other
tooling of the ecosystem for enabling JIT ES2015+), is currently
incorrectly dealing with nested classes.

The transform will accidentally visit nested classes (in a constructor)
multiple times and generate duplicated instances of the `ctorParameters`
fields. This does not sound like an issue at first, but the duplicated
`ctorParameters` fields will miss significant type information that has
been elided by the first visit, resulting in generated code like the
following:

```js
      let MyClass = /* @__PURE__ */ __name(class MyClass extends UpgradeNg1ComponentAdapter {
        constructor(scope, injector3, elementRef) {
        }
      }, "MyClass");
      MyClass.ctorParameters = () => [
        { type: void 0, decorators: [{ type: Inject, args: [$SCOPE] }] },
        { type: Injector },
        { type: ElementRef }
      ];
      MyClass.ctorParameters = () => [
        { type: void 0 }, // <---- NOTE!
        { type: Injector },
        { type: ElementRef }
      ];
```

PR Close #44281
2021-11-30 11:56:05 -05:00
..
integrationtest test: remove Ivy/ViewEngine switch helpers and obsolete tests (#44120) 2021-11-24 19:42:39 +00:00
linker refactor: delete the View Engine runtime (#43884) 2021-11-23 21:10:06 +00:00
ngcc test(ngcc): use main property in test package.json files for UMD tests (#44245) 2021-11-29 12:38:06 -05:00
private refactor(compiler-cli): expose tooling code through private entry-point (#43431) 2021-10-01 18:28:46 +00:00
src fix(compiler-cli): downlevel transform incorrectly extracting constructor parameters for nested classes (#44281) 2021-11-30 11:56:05 -05:00
test fix(compiler-cli): downlevel transform incorrectly extracting constructor parameters for nested classes (#44281) 2021-11-30 11:56:05 -05:00
BUILD.bazel build: enable code splitting for esbuild bundling of compiler-cli (#43932) 2021-10-26 23:58:27 +00:00
esbuild.config.js refactor: setup bundling for @angular/compiler-cli package (#43431) 2021-10-01 18:28:42 +00:00
import_meta_url.d.ts refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
index.ts refactor(compiler-cli): expose tooling code through private entry-point (#43431) 2021-10-01 18:28:46 +00:00
package.json feat(core): update node version support range to support v16 (#43740) 2021-10-06 10:55:44 -07:00
tsconfig-build.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00
tsconfig.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00