dillon1000/react
Commit
Browse files Fix unwinding starting with a wrong Fiber on error in the complete phase (#13237)
* Add a repro case for profiler unwinding
This currently fails the tests due to an unexpected warning.
* Add a regression test for context stack
* Simplify the first test case
* Update nextUnitOfWork inside completeUnitOfWork()
The bug was caused by a structure like this:
</Provider>
</div>
</errorInCompletePhase>
We forgot to update nextUnitOfWork so it was still pointing at Provider when errorInCompletePhase threw. As a result, we would try to unwind from Provider (rather than from errorInCompletePhase), and thus pop the Provider twice.Changed paths3 files
First-parent comparisonpackages/react-reconciler/src/ReactFiberScheduler.js ModifiedM packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js ModifiedM packages/react/src/__tests__/ReactProfiler-test.internal.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…