Skip to content
Permalink
Browse files
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
  • Loading branch information
alan-agius4 authored and AndrewKushnir committed Sep 9, 2021
1 parent ca510c8 commit 141fde1632b4834449cfd48dcebfc8b1b7d58e09
Showing with 2 additions and 2 deletions.
  1. +1 −1 packages/animations/browser/src/render/animation_driver.ts
  2. +1 −1 packages/animations/browser/src/render/special_cased_styles.ts
@@ -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};

0 comments on commit 141fde1

Please sign in to comment.