You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(compiler): incorrectly handling let declarations inside i18n (#60512)
The compiler wasn't handling `@let` declarations placed inside i18n blocks. The problem is that `assignI18nSlotDependencies` phase assigns the `target` of i18n ops much earlier than the `@let` optimization. If the `@let` ends up getting optimized because it isn't used in any child views, the pointer in the i18n instruction becomes invalid. This hadn't surfaced so far, because we didn't optimize `declareLet` ops, however once we do, we start hitting assertions that the optimized `declareLet` isn't used anywhere.
These changes resolve the issue by moving the i18n phases after the `@let` optimization.
PR Close#60512
const$MSG_ID_WITH_SUFFIX$=goog.getMsg("{$startTagNgTemplate}The result is {$interpolation}{$closeTagNgTemplate}",{
26
+
"closeTagNgTemplate": "\uFFFD/*3:1\uFFFD",
27
+
"interpolation": "\uFFFD0:1\uFFFD",
28
+
"startTagNgTemplate": "\uFFFD*3:1\uFFFD"
29
+
},{
30
+
original_code: {
31
+
"closeTagNgTemplate": "</ng-template>",
32
+
"interpolation": "{{result}}",
33
+
"startTagNgTemplate": "<ng-template>"
34
+
}
35
+
});
36
+
$i18n_0$=$MSG_ID_WITH_SUFFIX$;
37
+
}else{
38
+
$i18n_0$=$localize`${"\uFFFD*3:1\uFFFD"}:START_TAG_NG_TEMPLATE:The result is ${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"\uFFFD/*3:1\uFFFD"}:CLOSE_TAG_NG_TEMPLATE:`;
const$MSG_ID_WITH_SUFFIX$=goog.getMsg(" The result is {$interpolation} {$startTagNgTemplate}To repeat, the result is {$interpolation}{$closeTagNgTemplate}",{
$i18n_0$=$localize` The result is ${"[\uFFFD0\uFFFD|\uFFFD0:1\uFFFD]"}:INTERPOLATION: ${"\uFFFD*3:1\uFFFD"}:START_TAG_NG_TEMPLATE:To repeat, the result is ${"[\uFFFD0\uFFFD|\uFFFD0:1\uFFFD]"}:INTERPOLATION:${"\uFFFD/*3:1\uFFFD"}:CLOSE_TAG_NG_TEMPLATE:`;
0 commit comments