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

Function throwException

code/third-party/public/app.js:10234–10277  ·  view source on GitHub ↗
(returnFiber, sourceFiber, rawValue)

Source from the content-addressed store, hash-verified

10232
10233
10234 function throwException(returnFiber, sourceFiber, rawValue) {
10235 // The source fiber did not complete.
10236 sourceFiber.effectTag |= Incomplete;
10237 // Its effect list is no longer valid.
10238 sourceFiber.firstEffect = sourceFiber.lastEffect = null;
10239
10240 var value = createCapturedValue(rawValue, sourceFiber);
10241
10242 var workInProgress = returnFiber;
10243 do {
10244 switch (workInProgress.tag) {
10245 case HostRoot:
10246 {
10247 // Uncaught error
10248 var errorInfo = value;
10249 ensureUpdateQueues(workInProgress);
10250 var updateQueue = workInProgress.updateQueue;
10251 updateQueue.capturedValues = [errorInfo];
10252 workInProgress.effectTag |= ShouldCapture;
10253 return;
10254 }
10255 case ClassComponent:
10256 // Capture and retry
10257 var ctor = workInProgress.type;
10258 var _instance = workInProgress.stateNode;
10259 if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromCatch === 'function' && enableGetDerivedStateFromCatch || _instance !== null && typeof _instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(_instance))) {
10260 ensureUpdateQueues(workInProgress);
10261 var _updateQueue = workInProgress.updateQueue;
10262 var capturedValues = _updateQueue.capturedValues;
10263 if (capturedValues === null) {
10264 _updateQueue.capturedValues = [value];
10265 } else {
10266 capturedValues.push(value);
10267 }
10268 workInProgress.effectTag |= ShouldCapture;
10269 return;
10270 }
10271 break;
10272 default:
10273 break;
10274 }
10275 workInProgress = workInProgress['return'];
10276 } while (workInProgress !== null);
10277 }
10278
10279 function unwindWork(workInProgress) {
10280 switch (workInProgress.tag) {

Callers 1

renderRootFunction · 0.70

Calls 3

createCapturedValueFunction · 0.70
ensureUpdateQueuesFunction · 0.70

Tested by

no test coverage detected