Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): emit pure annotations to static property initializers (ang…
…ular#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 { }a exports.Injector = Injector; Injector.NULL = ( /* @__PURE__ */new NullInjector()); console.log(Injector.NULL); ``` PR Close angular#43344
- Loading branch information