MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / throwException

Function throwException

code/composition/public/app.js:11139–11182  ·  view source on GitHub ↗
(returnFiber, sourceFiber, rawValue)

Source from the content-addressed store, hash-verified

11137
11138
11139 function throwException(returnFiber, sourceFiber, rawValue) {
11140 // The source fiber did not complete.
11141 sourceFiber.effectTag |= Incomplete;
11142 // Its effect list is no longer valid.
11143 sourceFiber.firstEffect = sourceFiber.lastEffect = null;
11144
11145 var value = createCapturedValue(rawValue, sourceFiber);
11146
11147 var workInProgress = returnFiber;
11148 do {
11149 switch (workInProgress.tag) {
11150 case HostRoot:
11151 {
11152 // Uncaught error
11153 var errorInfo = value;
11154 ensureUpdateQueues(workInProgress);
11155 var updateQueue = workInProgress.updateQueue;
11156 updateQueue.capturedValues = [errorInfo];
11157 workInProgress.effectTag |= ShouldCapture;
11158 return;
11159 }
11160 case ClassComponent:
11161 // Capture and retry
11162 var ctor = workInProgress.type;
11163 var _instance = workInProgress.stateNode;
11164 if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromCatch === 'function' && enableGetDerivedStateFromCatch || _instance !== null && typeof _instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(_instance))) {
11165 ensureUpdateQueues(workInProgress);
11166 var _updateQueue = workInProgress.updateQueue;
11167 var capturedValues = _updateQueue.capturedValues;
11168 if (capturedValues === null) {
11169 _updateQueue.capturedValues = [value];
11170 } else {
11171 capturedValues.push(value);
11172 }
11173 workInProgress.effectTag |= ShouldCapture;
11174 return;
11175 }
11176 break;
11177 default:
11178 break;
11179 }
11180 workInProgress = workInProgress['return'];
11181 } while (workInProgress !== null);
11182 }
11183
11184 function unwindWork(workInProgress) {
11185 switch (workInProgress.tag) {

Callers 1

renderRootFunction · 0.70

Calls 3

createCapturedValueFunction · 0.70
ensureUpdateQueuesFunction · 0.70

Tested by

no test coverage detected