* Apply OpCodes associated with tearing ICU case. * * 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`
(tView: TView, tIcu: TIcu, lView: LView)
| 556 | * @param lView Current `LView` |
| 557 | */ |
| 558 | function applyIcuSwitchCaseRemove(tView: TView, tIcu: TIcu, lView: LView) { |
| 559 | let activeCaseIndex = getCurrentICUCaseIndex(tIcu, lView); |
| 560 | if (activeCaseIndex !== null) { |
| 561 | const removeCodes = tIcu.remove[activeCaseIndex]; |
| 562 | for (let i = 0; i < removeCodes.length; i++) { |
| 563 | const nodeOrIcuIndex = removeCodes[i] as number; |
| 564 | if (nodeOrIcuIndex > 0) { |
| 565 | // Positive numbers are `RNode`s. |
| 566 | const rNode = getNativeByIndex(nodeOrIcuIndex, lView); |
| 567 | rNode !== null && nativeRemoveNode(lView[RENDERER], rNode); |
| 568 | } else { |
| 569 | // Negative numbers are ICUs |
| 570 | applyIcuSwitchCaseRemove(tView, getTIcu(tView, ~nodeOrIcuIndex)!, lView); |
| 571 | } |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | /** |
| 577 | * Returns the index of the current case of an ICU expression depending on the main binding value |
no test coverage detected
searching dependent graphs…