MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / throwException

Function throwException

code/one-direction-data-flow/public/app.js:10874–10917  ·  view source on GitHub ↗
(returnFiber, sourceFiber, rawValue)

Source from the content-addressed store, hash-verified

10872
10873
10874 function throwException(returnFiber, sourceFiber, rawValue) {
10875 // The source fiber did not complete.
10876 sourceFiber.effectTag |= Incomplete;
10877 // Its effect list is no longer valid.
10878 sourceFiber.firstEffect = sourceFiber.lastEffect = null;
10879
10880 var value = createCapturedValue(rawValue, sourceFiber);
10881
10882 var workInProgress = returnFiber;
10883 do {
10884 switch (workInProgress.tag) {
10885 case HostRoot:
10886 {
10887 // Uncaught error
10888 var errorInfo = value;
10889 ensureUpdateQueues(workInProgress);
10890 var updateQueue = workInProgress.updateQueue;
10891 updateQueue.capturedValues = [errorInfo];
10892 workInProgress.effectTag |= ShouldCapture;
10893 return;
10894 }
10895 case ClassComponent:
10896 // Capture and retry
10897 var ctor = workInProgress.type;
10898 var _instance = workInProgress.stateNode;
10899 if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromCatch === 'function' && enableGetDerivedStateFromCatch || _instance !== null && typeof _instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(_instance))) {
10900 ensureUpdateQueues(workInProgress);
10901 var _updateQueue = workInProgress.updateQueue;
10902 var capturedValues = _updateQueue.capturedValues;
10903 if (capturedValues === null) {
10904 _updateQueue.capturedValues = [value];
10905 } else {
10906 capturedValues.push(value);
10907 }
10908 workInProgress.effectTag |= ShouldCapture;
10909 return;
10910 }
10911 break;
10912 default:
10913 break;
10914 }
10915 workInProgress = workInProgress['return'];
10916 } while (workInProgress !== null);
10917 }
10918
10919 function unwindWork(workInProgress) {
10920 switch (workInProgress.tag) {

Callers 1

renderRootFunction · 0.70

Calls 3

createCapturedValueFunction · 0.70
ensureUpdateQueuesFunction · 0.70

Tested by

no test coverage detected