Commit 0610a94
committed
Add warning if return pointer is inconsistent
Bugs caused by inconsistent return pointers are tricky to diagnose
because the source of the error is often in a different part of the
codebase from the actual mistake. For example, you might forget to set a
return pointer during the render phase, which later causes a crash in
the commit phase.
This adds a dev-only invariant to the commit phase to check for
inconsistencies. With this in place, we'll hopefully catch return
pointer errors quickly during local development, when we have the most
context for what might have caused it.1 parent c896cf9 commit 0610a94
File tree
3 files changed
+93
-0
lines changed- packages
- react-dom/src/__tests__
- react-noop-renderer/src
- react-reconciler/src
3 files changed
+93
-0
lines changedLines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| |||
300 | 301 | | |
301 | 302 | | |
302 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
303 | 308 | | |
304 | 309 | | |
305 | 310 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
| |||
496 | 497 | | |
497 | 498 | | |
498 | 499 | | |
| 500 | + | |
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
| |||
713 | 715 | | |
714 | 716 | | |
715 | 717 | | |
| 718 | + | |
716 | 719 | | |
717 | 720 | | |
718 | 721 | | |
| |||
751 | 754 | | |
752 | 755 | | |
753 | 756 | | |
| 757 | + | |
754 | 758 | | |
755 | 759 | | |
756 | 760 | | |
| |||
1172 | 1176 | | |
1173 | 1177 | | |
1174 | 1178 | | |
| 1179 | + | |
1175 | 1180 | | |
1176 | 1181 | | |
1177 | 1182 | | |
1178 | 1183 | | |
1179 | 1184 | | |
1180 | 1185 | | |
| 1186 | + | |
1181 | 1187 | | |
1182 | 1188 | | |
1183 | 1189 | | |
| |||
1224 | 1230 | | |
1225 | 1231 | | |
1226 | 1232 | | |
| 1233 | + | |
1227 | 1234 | | |
1228 | 1235 | | |
1229 | 1236 | | |
| |||
1757 | 1764 | | |
1758 | 1765 | | |
1759 | 1766 | | |
| 1767 | + | |
1760 | 1768 | | |
1761 | 1769 | | |
1762 | 1770 | | |
1763 | 1771 | | |
1764 | 1772 | | |
1765 | 1773 | | |
| 1774 | + | |
1766 | 1775 | | |
1767 | 1776 | | |
1768 | 1777 | | |
| |||
1808 | 1817 | | |
1809 | 1818 | | |
1810 | 1819 | | |
| 1820 | + | |
1811 | 1821 | | |
1812 | 1822 | | |
1813 | 1823 | | |
| |||
1886 | 1896 | | |
1887 | 1897 | | |
1888 | 1898 | | |
| 1899 | + | |
1889 | 1900 | | |
1890 | 1901 | | |
1891 | 1902 | | |
| |||
1904 | 1915 | | |
1905 | 1916 | | |
1906 | 1917 | | |
| 1918 | + | |
1907 | 1919 | | |
1908 | 1920 | | |
1909 | 1921 | | |
| |||
1941 | 1953 | | |
1942 | 1954 | | |
1943 | 1955 | | |
| 1956 | + | |
1944 | 1957 | | |
1945 | 1958 | | |
1946 | 1959 | | |
| |||
1968 | 1981 | | |
1969 | 1982 | | |
1970 | 1983 | | |
| 1984 | + | |
1971 | 1985 | | |
1972 | 1986 | | |
1973 | 1987 | | |
| |||
3178 | 3192 | | |
3179 | 3193 | | |
3180 | 3194 | | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
0 commit comments