(id: number, forceError: boolean)
| 7754 | } |
| 7755 | |
| 7756 | function overrideError(id: number, forceError: boolean) { |
| 7757 | if ( |
| 7758 | typeof setErrorHandler !== 'function' || |
| 7759 | typeof scheduleUpdate !== 'function' |
| 7760 | ) { |
| 7761 | throw new Error( |
| 7762 | 'Expected overrideError() to not get called for earlier React versions.', |
| 7763 | ); |
| 7764 | } |
| 7765 | |
| 7766 | const devtoolsInstance = idToDevToolsInstanceMap.get(id); |
| 7767 | if (devtoolsInstance === undefined) { |
| 7768 | return; |
| 7769 | } |
| 7770 | const nearestFiber = getNearestFiber(devtoolsInstance); |
| 7771 | if (nearestFiber === null) { |
| 7772 | return; |
| 7773 | } |
| 7774 | let fiber = nearestFiber; |
| 7775 | while (!isErrorBoundary(fiber)) { |
| 7776 | if (fiber.return === null) { |
| 7777 | return; |
| 7778 | } |
| 7779 | fiber = fiber.return; |
| 7780 | } |
| 7781 | forceErrorForFibers.set(fiber, forceError); |
| 7782 | if (fiber.alternate !== null) { |
| 7783 | // We only need one of the Fibers in the set. |
| 7784 | forceErrorForFibers.delete(fiber.alternate); |
| 7785 | } |
| 7786 | if (forceErrorForFibers.size === 1) { |
| 7787 | // First override is added. Switch React to slower path. |
| 7788 | setErrorHandler(shouldErrorFiberAccordingToMap); |
| 7789 | } |
| 7790 | if (!forceError && typeof scheduleRetry === 'function') { |
| 7791 | // If we're dismissing an error and the renderer supports it, use a Retry instead of Sync |
| 7792 | // This would allow View Transitions to proceed as if the error was dismissed using a Transition. |
| 7793 | scheduleRetry(fiber); |
| 7794 | } else { |
| 7795 | scheduleUpdate(fiber); |
| 7796 | } |
| 7797 | } |
| 7798 | |
| 7799 | function shouldSuspendFiberAlwaysFalse() { |
| 7800 | return false; |
nothing calls this directly
no test coverage detected