( parentDom: Element, lastChildren, nextChildren, context: object, isSvg: boolean, lastLength: number, nextLength: number )
| 166 | } |
| 167 | |
| 168 | function patchNonKeyedChildren ( |
| 169 | parentDom: Element, |
| 170 | lastChildren, |
| 171 | nextChildren, |
| 172 | context: object, |
| 173 | isSvg: boolean, |
| 174 | lastLength: number, |
| 175 | nextLength: number |
| 176 | ) { |
| 177 | const minLength = Math.min(lastLength, nextLength) |
| 178 | let i = 0 |
| 179 | while (i < minLength) { |
| 180 | patch(lastChildren[i], nextChildren[i], parentDom, context, isSvg) |
| 181 | i++ |
| 182 | } |
| 183 | if (lastLength < nextLength) { |
| 184 | for (i = minLength; i < nextLength; i++) { |
| 185 | if (parentDom !== null) { |
| 186 | const refVnode = lastChildren[i - 1] |
| 187 | mountElement( |
| 188 | createElement( |
| 189 | nextChildren[i], |
| 190 | isSvg, |
| 191 | context |
| 192 | ), |
| 193 | parentDom, |
| 194 | isValidElement(refVnode) && refVnode.dom != null |
| 195 | ? refVnode.dom.nextSibling |
| 196 | : null |
| 197 | ) |
| 198 | } |
| 199 | } |
| 200 | } else if (lastLength > nextLength) { |
| 201 | for (i = minLength; i < lastLength; i++) { |
| 202 | unmount(lastChildren[i], parentDom) |
| 203 | } |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * |
no test coverage detected