|
|
@ -88,35 +88,28 @@ do { |
|
|
|
|
|
|
|
|
|
|
|
```javascript |
|
|
|
```javascript |
|
|
|
do { |
|
|
|
do { |
|
|
|
{ |
|
|
|
{ |
|
|
|
invokeGuardedCallback( |
|
|
|
invokeGuardedCallback( |
|
|
|
null, |
|
|
|
null, |
|
|
|
commitMutationEffects, |
|
|
|
commitMutationEffects, |
|
|
|
null, |
|
|
|
null, |
|
|
|
root, |
|
|
|
root, |
|
|
|
renderPriorityLevel |
|
|
|
renderPriorityLevel |
|
|
|
); |
|
|
|
); |
|
|
|
if (hasCaughtError()) { |
|
|
|
if (hasCaughtError()) { |
|
|
|
|
|
|
|
if (!(nextEffect !== null)) { |
|
|
|
if (!(nextEffect !== null)) { |
|
|
|
{ |
|
|
|
{ |
|
|
|
throw Error( "Should be working on an effect." ); |
|
|
|
throw Error( "Should be working on an effect." ); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var _error = clearCaughtError(); |
|
|
|
|
|
|
|
captureCommitPhaseError(nextEffect, _error); |
|
|
|
|
|
|
|
nextEffect = nextEffect.nextEffect; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} while (nextEffect !== null); |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
和 before 的循环非常类似,commitMutationEffects 也是有 invokeGuardedCallback 调用,也有着相同 Error Boundaries 的逻辑 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
关于 commitMutationEffects: [[React 的深入探索 - commitMutationEffects]] |
|
|
|
var _error = clearCaughtError(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
captureCommitPhaseError(nextEffect, _error); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nextEffect = nextEffect.nextEffect; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} while (nextEffect !== null); |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|