Skip to content

Commit

Permalink
fix(animations): emit pure annotations to static property initializers (
Browse files Browse the repository at this point in the history
#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 c80278a commit 6c84c5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/animations/browser/src/render/animation_driver.ts
Expand Up @@ -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;

Expand Down
Expand Up @@ -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};
Expand Down

0 comments on commit 6c84c5f

Please sign in to comment.