angular-cn/packages/compiler-cli/ngcc/test/host
JoostK c4e039a43a fix(ngcc): correctly read static properties for aliased classes (#32619)
In ESM2015 bundles, a class with decorators may be emitted as follows:

```javascript
var MyClass_1;
let MyClass = MyClass_1 = class MyClass {};
MyClass.decorators = [/* here be decorators */];
```

Such a class has two declarations: the publicly visible `let MyClass`
and the implementation `class MyClass {}` node. In #32539 a refactoring
took place to handle such classes more consistently, however the logic
to find static properties was mistakenly kept identical to its broken
state before the refactor, by looking for static properties on the
implementation symbol (the one for `class MyClass {}`) whereas the
static properties need to be obtained from the symbol corresponding with
the `let MyClass` declaration, as that is where the `decorators`
property is assigned to in the example above.

This commit fixes the behavior by looking for static properties on the
public declaration symbol. This fixes an issue where decorators were not
found for classes that do in fact have decorators, therefore preventing
the classes from being compiled for Ivy.

Fixes #31791

PR Close #32619
2019-09-12 13:18:20 -07:00
..
commonjs_host_import_helper_spec.ts fix(ivy): ngcc - render decorators in UMD and CommonJS bundles correctly (#31614) 2019-07-29 16:10:58 -07:00
commonjs_host_spec.ts fix(ngcc): consistently use outer declaration for classes (#32539) 2019-09-12 11:12:10 -07:00
esm5_host_import_helper_spec.ts fix(ivy): in ngcc, handle inline exports in commonjs code (#32129) 2019-08-15 14:45:59 -07:00
esm5_host_spec.ts fix(ngcc): consistently use outer declaration for classes (#32539) 2019-09-12 11:12:10 -07:00
esm2015_host_import_helper_spec.ts fix(ivy): ngcc - render decorators in UMD and CommonJS bundles correctly (#31614) 2019-07-29 16:10:58 -07:00
esm2015_host_spec.ts fix(ngcc): correctly read static properties for aliased classes (#32619) 2019-09-12 13:18:20 -07:00
umd_host_import_helper_spec.ts fix(ivy): ngcc - render decorators in UMD and CommonJS bundles correctly (#31614) 2019-07-29 16:10:58 -07:00
umd_host_spec.ts fix(ngcc): consistently use outer declaration for classes (#32539) 2019-09-12 11:12:10 -07:00
util.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00