(bookKeeping, child, childKey)
| 19194 | } |
| 19195 | |
| 19196 | function mapSingleChildIntoContext(bookKeeping, child, childKey) { |
| 19197 | var result = bookKeeping.result, |
| 19198 | keyPrefix = bookKeeping.keyPrefix, |
| 19199 | func = bookKeeping.func, |
| 19200 | context = bookKeeping.context; |
| 19201 | |
| 19202 | |
| 19203 | var mappedChild = func.call(context, child, bookKeeping.count++); |
| 19204 | if (Array.isArray(mappedChild)) { |
| 19205 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); |
| 19206 | } else if (mappedChild != null) { |
| 19207 | if (isValidElement(mappedChild)) { |
| 19208 | mappedChild = cloneAndReplaceKey(mappedChild, |
| 19209 | // Keep both the (mapped) and old keys if they differ, just as |
| 19210 | // traverseAllChildren used to do for objects as children |
| 19211 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); |
| 19212 | } |
| 19213 | result.push(mappedChild); |
| 19214 | } |
| 19215 | } |
| 19216 | |
| 19217 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { |
| 19218 | var escapedPrefix = ''; |
nothing calls this directly
no test coverage detected