(bookKeeping, child, childKey)
| 19332 | } |
| 19333 | |
| 19334 | function mapSingleChildIntoContext(bookKeeping, child, childKey) { |
| 19335 | var result = bookKeeping.result, |
| 19336 | keyPrefix = bookKeeping.keyPrefix, |
| 19337 | func = bookKeeping.func, |
| 19338 | context = bookKeeping.context; |
| 19339 | |
| 19340 | |
| 19341 | var mappedChild = func.call(context, child, bookKeeping.count++); |
| 19342 | if (Array.isArray(mappedChild)) { |
| 19343 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); |
| 19344 | } else if (mappedChild != null) { |
| 19345 | if (isValidElement(mappedChild)) { |
| 19346 | mappedChild = cloneAndReplaceKey(mappedChild, |
| 19347 | // Keep both the (mapped) and old keys if they differ, just as |
| 19348 | // traverseAllChildren used to do for objects as children |
| 19349 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); |
| 19350 | } |
| 19351 | result.push(mappedChild); |
| 19352 | } |
| 19353 | } |
| 19354 | |
| 19355 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { |
| 19356 | var escapedPrefix = ''; |
nothing calls this directly
no test coverage detected