Commit b2e9706
authored
Explicitly handle JSX tags in order (#486)
Virtual code generation from estree expressions was based on an
assumption of the order in which JSXIdentifier nodes are visited.
`estree-walker` visits the nodes in property order. The parser generates
AST properties in an order that broke our code generation. As a result,
the string `_components.` was injected in an incorrect position in the
virtual code, yielding syntax errors.
This is now resolved by explicitly handling `JSXElement` nodes in both
the enter and leave methods, instead of just handling `JSXIdentifier`
nodes.
Closes #4851 parent d73050c commit b2e9706
3 files changed
Lines changed: 67 additions & 17 deletions
File tree
- .changeset
- packages/language-service
- lib
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
452 | 473 | | |
453 | 474 | | |
454 | 475 | | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
| 476 | + | |
| 477 | + | |
464 | 478 | | |
465 | 479 | | |
466 | 480 | | |
| |||
500 | 514 | | |
501 | 515 | | |
502 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
503 | 527 | | |
504 | 528 | | |
505 | 529 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1752 | 1752 | | |
1753 | 1753 | | |
1754 | 1754 | | |
| 1755 | + | |
1755 | 1756 | | |
1756 | | - | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
1757 | 1761 | | |
1758 | 1762 | | |
1759 | 1763 | | |
| |||
1799 | 1803 | | |
1800 | 1804 | | |
1801 | 1805 | | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
1805 | 1818 | | |
1806 | 1819 | | |
1807 | 1820 | | |
| |||
1845 | 1858 | | |
1846 | 1859 | | |
1847 | 1860 | | |
| 1861 | + | |
1848 | 1862 | | |
1849 | 1863 | | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
1850 | 1867 | | |
1851 | 1868 | | |
1852 | 1869 | | |
| |||
1870 | 1887 | | |
1871 | 1888 | | |
1872 | 1889 | | |
1873 | | - | |
1874 | | - | |
1875 | | - | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
1876 | 1893 | | |
1877 | 1894 | | |
1878 | 1895 | | |
| |||
1891 | 1908 | | |
1892 | 1909 | | |
1893 | 1910 | | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
1894 | 1915 | | |
1895 | 1916 | | |
1896 | 1917 | | |
| |||
0 commit comments