(workInProgress, context, changedBits, renderExpirationTime)
| 10364 | } |
| 10365 | |
| 10366 | function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) { |
| 10367 | var fiber = workInProgress.child; |
| 10368 | if (fiber !== null) { |
| 10369 | // Set the return pointer of the child to the work-in-progress fiber. |
| 10370 | fiber['return'] = workInProgress; |
| 10371 | } |
| 10372 | while (fiber !== null) { |
| 10373 | var nextFiber = void 0; |
| 10374 | // Visit this fiber. |
| 10375 | switch (fiber.tag) { |
| 10376 | case ContextConsumer: |
| 10377 | // Check if the context matches. |
| 10378 | var observedBits = fiber.stateNode | 0; |
| 10379 | if (fiber.type === context && (observedBits & changedBits) !== 0) { |
| 10380 | // Update the expiration time of all the ancestors, including |
| 10381 | // the alternates. |
| 10382 | var node = fiber; |
| 10383 | while (node !== null) { |
| 10384 | var alternate = node.alternate; |
| 10385 | if (node.expirationTime === NoWork || node.expirationTime > renderExpirationTime) { |
| 10386 | node.expirationTime = renderExpirationTime; |
| 10387 | if (alternate !== null && (alternate.expirationTime === NoWork || alternate.expirationTime > renderExpirationTime)) { |
| 10388 | alternate.expirationTime = renderExpirationTime; |
| 10389 | } |
| 10390 | } else if (alternate !== null && (alternate.expirationTime === NoWork || alternate.expirationTime > renderExpirationTime)) { |
| 10391 | alternate.expirationTime = renderExpirationTime; |
| 10392 | } else { |
| 10393 | // Neither alternate was updated, which means the rest of the |
| 10394 | // ancestor path already has sufficient priority. |
| 10395 | break; |
| 10396 | } |
| 10397 | node = node['return']; |
| 10398 | } |
| 10399 | // Don't scan deeper than a matching consumer. When we render the |
| 10400 | // consumer, we'll continue scanning from that point. This way the |
| 10401 | // scanning work is time-sliced. |
| 10402 | nextFiber = null; |
| 10403 | } else { |
| 10404 | // Traverse down. |
| 10405 | nextFiber = fiber.child; |
| 10406 | } |
| 10407 | break; |
| 10408 | case ContextProvider: |
| 10409 | // Don't scan deeper if this is a matching provider |
| 10410 | nextFiber = fiber.type === workInProgress.type ? null : fiber.child; |
| 10411 | break; |
| 10412 | default: |
| 10413 | // Traverse down. |
| 10414 | nextFiber = fiber.child; |
| 10415 | break; |
| 10416 | } |
| 10417 | if (nextFiber !== null) { |
| 10418 | // Set the return pointer of the child to the work-in-progress fiber. |
| 10419 | nextFiber['return'] = fiber; |
| 10420 | } else { |
| 10421 | // No child. Traverse to next sibling. |
| 10422 | nextFiber = fiber; |
| 10423 | while (nextFiber !== null) { |
no outgoing calls
no test coverage detected