(fiber, expirationTime, isErrorRecovery)
| 13506 | } |
| 13507 | |
| 13508 | function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) { |
| 13509 | recordScheduleUpdate(); |
| 13510 | |
| 13511 | { |
| 13512 | if (!isErrorRecovery && fiber.tag === ClassComponent) { |
| 13513 | var instance = fiber.stateNode; |
| 13514 | warnAboutInvalidUpdates(instance); |
| 13515 | } |
| 13516 | } |
| 13517 | |
| 13518 | var node = fiber; |
| 13519 | while (node !== null) { |
| 13520 | // Walk the parent path to the root and update each node's |
| 13521 | // expiration time. |
| 13522 | if (node.expirationTime === NoWork || node.expirationTime > expirationTime) { |
| 13523 | node.expirationTime = expirationTime; |
| 13524 | } |
| 13525 | if (node.alternate !== null) { |
| 13526 | if (node.alternate.expirationTime === NoWork || node.alternate.expirationTime > expirationTime) { |
| 13527 | node.alternate.expirationTime = expirationTime; |
| 13528 | } |
| 13529 | } |
| 13530 | if (node['return'] === null) { |
| 13531 | if (node.tag === HostRoot) { |
| 13532 | var root = node.stateNode; |
| 13533 | if (!isWorking && nextRenderExpirationTime !== NoWork && expirationTime < nextRenderExpirationTime) { |
| 13534 | // This is an interruption. (Used for performance tracking.) |
| 13535 | interruptedBy = fiber; |
| 13536 | resetStack(); |
| 13537 | } |
| 13538 | if (nextRoot !== root || !isWorking) { |
| 13539 | requestWork(root, expirationTime); |
| 13540 | } |
| 13541 | if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { |
| 13542 | invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.'); |
| 13543 | } |
| 13544 | } else { |
| 13545 | { |
| 13546 | if (!isErrorRecovery && fiber.tag === ClassComponent) { |
| 13547 | warnAboutUpdateOnUnmounted(fiber); |
| 13548 | } |
| 13549 | } |
| 13550 | return; |
| 13551 | } |
| 13552 | } |
| 13553 | node = node['return']; |
| 13554 | } |
| 13555 | } |
| 13556 | |
| 13557 | function recalculateCurrentTime() { |
| 13558 | // Subtract initial time so it fits inside 32bits |
no test coverage detected