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

Function throwException

code/higher-order-components/public/app.js:10995–11038  ·  view source on GitHub ↗
(returnFiber, sourceFiber, rawValue)

Source from the content-addressed store, hash-verified

10993
10994
10995 function throwException(returnFiber, sourceFiber, rawValue) {
10996 // The source fiber did not complete.
10997 sourceFiber.effectTag |= Incomplete;
10998 // Its effect list is no longer valid.
10999 sourceFiber.firstEffect = sourceFiber.lastEffect = null;
11000
11001 var value = createCapturedValue(rawValue, sourceFiber);
11002
11003 var workInProgress = returnFiber;
11004 do {
11005 switch (workInProgress.tag) {
11006 case HostRoot:
11007 {
11008 // Uncaught error
11009 var errorInfo = value;
11010 ensureUpdateQueues(workInProgress);
11011 var updateQueue = workInProgress.updateQueue;
11012 updateQueue.capturedValues = [errorInfo];
11013 workInProgress.effectTag |= ShouldCapture;
11014 return;
11015 }
11016 case ClassComponent:
11017 // Capture and retry
11018 var ctor = workInProgress.type;
11019 var _instance = workInProgress.stateNode;
11020 if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromCatch === 'function' && enableGetDerivedStateFromCatch || _instance !== null && typeof _instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(_instance))) {
11021 ensureUpdateQueues(workInProgress);
11022 var _updateQueue = workInProgress.updateQueue;
11023 var capturedValues = _updateQueue.capturedValues;
11024 if (capturedValues === null) {
11025 _updateQueue.capturedValues = [value];
11026 } else {
11027 capturedValues.push(value);
11028 }
11029 workInProgress.effectTag |= ShouldCapture;
11030 return;
11031 }
11032 break;
11033 default:
11034 break;
11035 }
11036 workInProgress = workInProgress['return'];
11037 } while (workInProgress !== null);
11038 }
11039
11040 function unwindWork(workInProgress) {
11041 switch (workInProgress.tag) {

Callers 1

renderRootFunction · 0.70

Calls 3

createCapturedValueFunction · 0.70
ensureUpdateQueuesFunction · 0.70

Tested by

no test coverage detected