fix(animations): emit pure annotations to static property initializers (#43344)

Currently the pure annotations comments are not emitted because unless the entire expression is wrapped in braces.

See the below TypeScript playgrounds

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=8&ssc=1&pln=1&pc=1#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQA9ACpoAAQD6+gAryASgFFD0LRuipMAdziIUGbPgIAKAJQBuKhTUlMB4qBB4IJgAdCB4AOaegu6EUbBKin5UQA
```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = new NullInjector();
console.log(Injector.NULL);

```

https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Injector = void 0;
class NullInjector {
}
class Injector {
}
exports.Injector = Injector;
Injector.NULL = ( /* @__PURE__ */new NullInjector());
console.log(Injector.NULL);
```

PR Close #43344
This commit is contained in:
Alan Agius
2021-09-04 11:35:38 +02:00
committed by Andrew Kushnir
parent c80278ac4a
commit 6c84c5f513
2 changed files with 2 additions and 2 deletions
@@ -47,7 +47,7 @@ export class NoopAnimationDriver implements AnimationDriver {
* @publicApi
*/
export abstract class AnimationDriver {
static NOOP: AnimationDriver = /* @__PURE__ */ new NoopAnimationDriver();
static NOOP: AnimationDriver = (/* @__PURE__ */ new NoopAnimationDriver());
abstract validateStyleProperty(prop: string): boolean;
@@ -44,7 +44,7 @@ export function packageNonAnimatableStyles(
* `destroy()` is called then all styles will be removed.
*/
export class SpecialCasedStyles {
static initialStylesByElement = /* @__PURE__ */ new WeakMap<any, {[key: string]: any}>();
static initialStylesByElement = (/* @__PURE__ */ new WeakMap<any, {[key: string]: any}>());
private _state = SpecialCasedStylesState.Pending;
private _initialStyles!: {[key: string]: any};