( tView: TView, tNode: TNode, currentTNode: TNode | null, isParent: boolean, )
| 176 | } |
| 177 | |
| 178 | function linkTNodeInTView( |
| 179 | tView: TView, |
| 180 | tNode: TNode, |
| 181 | currentTNode: TNode | null, |
| 182 | isParent: boolean, |
| 183 | ) { |
| 184 | if (tView.firstChild === null) { |
| 185 | tView.firstChild = tNode; |
| 186 | } |
| 187 | if (currentTNode !== null) { |
| 188 | if (isParent) { |
| 189 | // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify? |
| 190 | if (currentTNode.child == null && tNode.parent !== null) { |
| 191 | // We are in the same view, which means we are adding content node to the parent view. |
| 192 | currentTNode.child = tNode; |
| 193 | } |
| 194 | } else { |
| 195 | if (currentTNode.next === null) { |
| 196 | // In the case of i18n the `currentTNode` may already be linked, in which case we don't want |
| 197 | // to break the links which i18n created. |
| 198 | currentTNode.next = tNode; |
| 199 | tNode.prev = currentTNode; |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Constructs a TNode object from the arguments. |
no outgoing calls
no test coverage detected
searching dependent graphs…