Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: emit pure annotations to static property initializers #43344

Closed
wants to merge 2 commits into from
Closed

fix: emit pure annotations to static property initializers #43344

wants to merge 2 commits into from

Commits on Sep 4, 2021

  1. fix(core): emit pure annotations to static property initializers

    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 {
    }a
    exports.Injector = Injector;
    Injector.NULL = ( /* @__PURE__ */new NullInjector());
    console.log(Injector.NULL);
    ```
    alan-agius4 committed Sep 4, 2021
    Copy the full SHA
    662b8b7 View commit details
    Browse the repository at this point in the history
  2. fix(animations): emit pure annotations to static property initializers

    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);
    ```
    alan-agius4 committed Sep 4, 2021
    Copy the full SHA
    a65b332 View commit details
    Browse the repository at this point in the history