angular-cn/packages/compiler-cli/ngcc/test/host
Pete Bacon Darwin d7440c452a fix(ngcc): ensure reflection hosts can handle TS 3.9 IIFE wrapped classes (#36989)
In TS 3.9, ES2015 output can contain ES classes that are wrapped in an
IIFE. So now ES2015 class declarations can look like one of:

```
class OuterClass1 {}
```

```
let OuterClass = class InnerClass {};
```

```
var AliasClass;
let OuterClass = AliasClass = class InnerClass {};
```

```
let OuterClass = (() => class InnerClass {}};
```

```
var AliasClass;
let OuterClass = AliasClass = (() => class InnerClass {})();
```

```
let OuterClass = (() => {
  let AdjacentClass = class InnerClass {};
  // ... static properties or decorators attached to `AdjacentClass`
  return AdjacentClass;
})();
```

```
var AliasClass;
let OuterClass = AliasClass = (() => {
  let AdjacentClass = class InnerClass {};
  // ... static properties or decorators attached to `AdjacentClass`
  return AdjacentClass;
})();
```

The `Esm5ReflectionHost` already handles slightly different IIFE wrappers
around function-based classes. This can be substantially reused when
fixing `Esm2015ReflectionHost`, since there is a lot of commonality
between the two.

This commit moves code from the `Esm5ReflectionHost` into the `Esm2015ReflectionHost`
and looks to share as much as possible between the two hosts.

PR Close #36989
2020-05-14 10:50:29 -07:00
..
commonjs_host_import_helper_spec.ts style(ngcc): reformat of ngcc after clang update (#36447) 2020-04-06 09:26:57 -07:00
commonjs_host_spec.ts fix(ngcc): ensure reflection hosts can handle TS 3.9 IIFE wrapped classes (#36989) 2020-05-14 10:50:29 -07:00
esm5_host_import_helper_spec.ts fix(ngcc): ensure reflection hosts can handle TS 3.9 IIFE wrapped classes (#36989) 2020-05-14 10:50:29 -07:00
esm5_host_spec.ts fix(ngcc): ensure reflection hosts can handle TS 3.9 IIFE wrapped classes (#36989) 2020-05-14 10:50:29 -07:00
esm2015_host_import_helper_spec.ts refactor(ngcc): remove unused import (#36989) 2020-05-14 10:50:28 -07:00
esm2015_host_spec.ts fix(ngcc): ensure reflection hosts can handle TS 3.9 IIFE wrapped classes (#36989) 2020-05-14 10:50:29 -07:00
umd_host_import_helper_spec.ts style(ngcc): reformat of ngcc after clang update (#36447) 2020-04-06 09:26:57 -07:00
umd_host_spec.ts fix(ngcc): ensure reflection hosts can handle TS 3.9 IIFE wrapped classes (#36989) 2020-05-14 10:50:29 -07:00
util.ts fix(compiler): handle type references to namespaced symbols correctly (#36106) 2020-04-09 11:32:21 -07:00