(root: FiberRootNode, thrownValue: any)
| 427 | } |
| 428 | |
| 429 | function handleThrow(root: FiberRootNode, thrownValue: any): void { |
| 430 | /* |
| 431 | throw可能的情况 |
| 432 | 1. use thenable |
| 433 | 2. error (Error Boundary处理) |
| 434 | */ |
| 435 | if (thrownValue === SuspenseException) { |
| 436 | workInProgressSuspendedReason = SuspendedOnData; |
| 437 | thrownValue = getSuspenseThenable(); |
| 438 | } else { |
| 439 | const isWakeable = |
| 440 | thrownValue !== null && |
| 441 | typeof thrownValue === 'object' && |
| 442 | typeof thrownValue.then === 'function'; |
| 443 | |
| 444 | workInProgressThrownValue = thrownValue; |
| 445 | workInProgressSuspendedReason = isWakeable |
| 446 | ? SuspendedOnDeprecatedThrowPromise |
| 447 | : SuspendedOnError; |
| 448 | } |
| 449 | workInProgressThrownValue = thrownValue; |
| 450 | } |
| 451 | |
| 452 | function throwAndUnwindWorkLoop( |
| 453 | root: FiberRootNode, |
no test coverage detected