* Apply OpCodes associated with switching a case on ICU. * * This involves tearing down existing case and than building up a new case. * * @param tView Current `TView` * @param tIcu Current `TIcu` * @param lView Current `LView` * @param value Value of the case to update to.
(tView: TView, tIcu: TIcu, lView: LView, value: string)
| 528 | * @param value Value of the case to update to. |
| 529 | */ |
| 530 | function applyIcuSwitchCase(tView: TView, tIcu: TIcu, lView: LView, value: string) { |
| 531 | // Rebuild a new case for this ICU |
| 532 | const caseIndex = getCaseIndex(tIcu, value); |
| 533 | let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView); |
| 534 | if (activeCaseIndex !== caseIndex) { |
| 535 | applyIcuSwitchCaseRemove(tView, tIcu, lView); |
| 536 | lView[tIcu.currentCaseLViewIndex] = caseIndex === null ? null : ~caseIndex; |
| 537 | if (caseIndex !== null) { |
| 538 | // Add the nodes for the new case |
| 539 | const anchorRNode = lView[tIcu.anchorIdx]; |
| 540 | if (anchorRNode) { |
| 541 | ngDevMode && assertDomNode(anchorRNode); |
| 542 | applyMutableOpCodes(tView, tIcu.create[caseIndex], lView, anchorRNode); |
| 543 | } |
| 544 | claimDehydratedIcuCase(lView, tIcu.anchorIdx, caseIndex); |
| 545 | } |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | /** |
| 550 | * Apply OpCodes associated with tearing ICU case. |
no test coverage detected
searching dependent graphs…