angular-cn/packages/compiler-cli/ngcc/test/host
JoostK e666d283dd fix(ngcc): correctly associate decorators with aliased classes (#33878)
In flat bundle formats, multiple classes that have the same name can be
suffixed to become unique. In ES5-like bundles this results in the outer
declaration from having a different name from the "implementation"
declaration within the class' IIFE, as the implementation declaration
may not have been suffixed.

As an example, the following code would fail to have a `Directive`
decorator as ngcc would search for `__decorate` calls that refer to
`AliasedDirective$1` by name, whereas the `__decorate` call actually
uses the `AliasedDirective` name.

```javascript
var AliasedDirective$1 = /** @class */ (function () {
    function AliasedDirective() {}
    AliasedDirective = tslib_1.__decorate([
        Directive({ selector: '[someDirective]' }),
    ], AliasedDirective);
    return AliasedDirective;
}());
```

This commit fixes the problem by not relying on comparing names, but
instead finding the declaration and matching it with both the outer
and inner declaration.

PR Close #33878
2019-11-18 09:10:35 -08:00
..
commonjs_host_import_helper_spec.ts fix(ngcc): correctly associate decorators with aliased classes (#33878) 2019-11-18 09:10:35 -08:00
commonjs_host_spec.ts fix(ngcc): support minified ES5 scenarios (#33777) 2019-11-13 11:11:48 -08:00
esm5_host_import_helper_spec.ts fix(ngcc): correctly associate decorators with aliased classes (#33878) 2019-11-18 09:10:35 -08:00
esm5_host_spec.ts fix(ngcc): support minified ES5 scenarios (#33777) 2019-11-13 11:11:48 -08:00
esm2015_host_import_helper_spec.ts test(ngcc): avoid using spy in `Esm2015ReflectionHost` test (#33878) 2019-11-18 09:10:35 -08:00
esm2015_host_spec.ts fix(ngcc): ensure that adjacent statements go after helper calls (#33689) 2019-11-11 13:01:15 -08:00
umd_host_import_helper_spec.ts fix(ngcc): correctly associate decorators with aliased classes (#33878) 2019-11-18 09:10:35 -08:00
umd_host_spec.ts fix(ngcc): support minified ES5 scenarios (#33777) 2019-11-13 11:11:48 -08:00
util.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00