Commit 56e4adb
fix(queries): read member query options like ngtsc, and check
Member query decorators (`@ViewChild`, `@ContentChildren`, ...) now go
through the same code as `queries:` (ngtsc uses one function for both,
`extractDecoratorQueryMetadata`):
- `static`, `descendants` and `emitDistinctChangesOnly` are evaluated, so
`{emitDistinctChangesOnly: FLAG}` with `const FLAG = false` gives flag 1
like ngtsc (it was 5), and parenthesized or `as` options are read.
- A non-boolean option, options that aren't an object literal
(`@ViewChild('x', OPTS)`), a predicate that can't be interpreted, and
missing or extra arguments report ngtsc's errors, at the node ngtsc
points to. An imported option reports the other-module error.
The public `extract_*` functions without the file's imports keep reading
literals only.
The diagnostic pass read `queries:` without the source text, so a
function-expression predicate (`new ViewChild(function Token() {})`) was
compiled but also reported as "predicate cannot be interpreted". It now
reads it the way the class is compiled.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>queries: with the source text1 parent d6df748 commit 56e4adb
5 files changed
Lines changed: 1466 additions & 33 deletions
File tree
- crates/oxc_angular_compiler
- src
- component
- directive
- tests
- fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2579 | 2579 | | |
2580 | 2580 | | |
2581 | 2581 | | |
2582 | | - | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
2583 | 2588 | | |
2584 | 2589 | | |
2585 | 2590 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1033 | 1033 | | |
1034 | 1034 | | |
1035 | 1035 | | |
1036 | | - | |
| 1036 | + | |
| 1037 | + | |
1037 | 1038 | | |
1038 | 1039 | | |
1039 | | - | |
| 1040 | + | |
| 1041 | + | |
1040 | 1042 | | |
1041 | 1043 | | |
1042 | 1044 | | |
| 1045 | + | |
1043 | 1046 | | |
1044 | 1047 | | |
1045 | 1048 | | |
1046 | 1049 | | |
1047 | 1050 | | |
1048 | | - | |
| 1051 | + | |
1049 | 1052 | | |
1050 | 1053 | | |
1051 | 1054 | | |
| |||
1123 | 1126 | | |
1124 | 1127 | | |
1125 | 1128 | | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1126 | 1133 | | |
1127 | 1134 | | |
1128 | | - | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1129 | 1144 | | |
1130 | 1145 | | |
1131 | 1146 | | |
1132 | 1147 | | |
1133 | 1148 | | |
1134 | 1149 | | |
1135 | 1150 | | |
| 1151 | + | |
1136 | 1152 | | |
1137 | 1153 | | |
1138 | 1154 | | |
| |||
Lines changed: 88 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
862 | 884 | | |
863 | 885 | | |
864 | 886 | | |
| |||
869 | 891 | | |
870 | 892 | | |
871 | 893 | | |
872 | | - | |
| 894 | + | |
873 | 895 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
888 | 899 | | |
889 | | - | |
| 900 | + | |
890 | 901 | | |
891 | 902 | | |
892 | | - | |
| 903 | + | |
893 | 904 | | |
894 | 905 | | |
895 | 906 | | |
| |||
1798 | 1809 | | |
1799 | 1810 | | |
1800 | 1811 | | |
1801 | | - | |
1802 | | - | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
1803 | 1815 | | |
1804 | 1816 | | |
1805 | 1817 | | |
| |||
1849 | 1861 | | |
1850 | 1862 | | |
1851 | 1863 | | |
1852 | | - | |
1853 | | - | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
1854 | 1916 | | |
1855 | 1917 | | |
1856 | 1918 | | |
1857 | 1919 | | |
1858 | 1920 | | |
1859 | | - | |
1860 | | - | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1861 | 1924 | | |
1862 | 1925 | | |
1863 | 1926 | | |
1864 | | - | |
1865 | 1927 | | |
1866 | | - | |
| 1928 | + | |
1867 | 1929 | | |
1868 | 1930 | | |
1869 | 1931 | | |
| |||
1940 | 2002 | | |
1941 | 2003 | | |
1942 | 2004 | | |
1943 | | - | |
| 2005 | + | |
1944 | 2006 | | |
1945 | 2007 | | |
1946 | 2008 | | |
| |||
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | | - | |
| 912 | + | |
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| |||
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
964 | 1004 | | |
0 commit comments