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
fix: emit pure annotations to static property initializers #43344
Conversation
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); ```
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); ```
Needed to address size check failures in #42598 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
#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
) 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 #43344
#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
…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
angular#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 angular#43344
…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
angular#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 angular#43344
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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
https://www.typescriptlang.org/play?target=99&module=1&ts=4.4.2&ssl=4&ssc=18&pln=4&pc=33#code/MYGwhgzhAEByCuIQEkB2ArApsALgewCdoBvAXwFgAoKzADwAdCdowAjCHAsXaUSGNFlyESVaNA5gcAS2BwAqgBlF0ALzQAFAHoAVNAACAfUMAFeQCUAoseg6t0VJgDucRCgzZ8BDQEofAbioKakpgPFQIPBBMADoQPABzDUFPQhjYJUUAqiA