Commit fce544d
fix: i18n attribute bindings should not inflate xref IDs for @for index variables
In Angular's TS compiler, BindingOp.i18nMessage stores a direct object
reference to the i18n.Message -- no XrefId is allocated during ingest.
The xref for the i18n context is only allocated later in the
create_i18n_contexts phase.
Oxc was allocating xrefs for i18n messages during ingest, inflating the
xref counter and causing @for body views to get higher xref values than
Angular. This made generated variable names like ɵ$index_N use the wrong
N value (e.g., ɵ$index_70 instead of ɵ$index_66).
Change i18n_message fields from Option<XrefId> to Option<u32> across all
ops, using the i18n message's instance_id as a dedup key instead of
allocating xrefs. This matches Angular TS's approach of using object
identity for dedup without consuming xref slots.
Fixes 8 mismatched files in the ClickUp comparison (158 → 150).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent b1141ac commit fce544d
File tree
9 files changed
+226
-181
lines changed- crates/oxc_angular_compiler
- src
- ir
- pipeline
- phases
- tests
- snapshots
9 files changed
+226
-181
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1264 | 1264 | | |
1265 | 1265 | | |
1266 | 1266 | | |
1267 | | - | |
1268 | | - | |
| 1267 | + | |
| 1268 | + | |
1269 | 1269 | | |
1270 | 1270 | | |
1271 | 1271 | | |
| |||
1289 | 1289 | | |
1290 | 1290 | | |
1291 | 1291 | | |
1292 | | - | |
1293 | | - | |
| 1292 | + | |
| 1293 | + | |
1294 | 1294 | | |
1295 | 1295 | | |
1296 | 1296 | | |
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | | - | |
1325 | | - | |
| 1324 | + | |
| 1325 | + | |
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
| |||
1365 | 1365 | | |
1366 | 1366 | | |
1367 | 1367 | | |
1368 | | - | |
1369 | | - | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
1370 | 1373 | | |
1371 | 1374 | | |
1372 | 1375 | | |
| |||
1439 | 1442 | | |
1440 | 1443 | | |
1441 | 1444 | | |
1442 | | - | |
1443 | | - | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
1444 | 1452 | | |
1445 | 1453 | | |
1446 | 1454 | | |
| |||
1522 | 1530 | | |
1523 | 1531 | | |
1524 | 1532 | | |
1525 | | - | |
1526 | | - | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
1527 | 1537 | | |
1528 | 1538 | | |
1529 | 1539 | | |
| |||
1608 | 1618 | | |
1609 | 1619 | | |
1610 | 1620 | | |
1611 | | - | |
1612 | | - | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
1613 | 1625 | | |
1614 | 1626 | | |
1615 | 1627 | | |
| |||
1811 | 1823 | | |
1812 | 1824 | | |
1813 | 1825 | | |
1814 | | - | |
1815 | | - | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
1816 | 1830 | | |
1817 | 1831 | | |
1818 | 1832 | | |
| |||
1843 | 1857 | | |
1844 | 1858 | | |
1845 | 1859 | | |
1846 | | - | |
1847 | | - | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1848 | 1864 | | |
1849 | 1865 | | |
1850 | 1866 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 142 | + | |
145 | 143 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
152 | 148 | | |
153 | 149 | | |
154 | 150 | | |
| |||
227 | 223 | | |
228 | 224 | | |
229 | 225 | | |
230 | | - | |
231 | 226 | | |
232 | 227 | | |
233 | 228 | | |
| |||
257 | 252 | | |
258 | 253 | | |
259 | 254 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | 255 | | |
278 | 256 | | |
279 | 257 | | |
| |||
0 commit comments