(bookKeeping, child, childKey)
| 18555 | } |
| 18556 | |
| 18557 | function mapSingleChildIntoContext(bookKeeping, child, childKey) { |
| 18558 | var result = bookKeeping.result, |
| 18559 | keyPrefix = bookKeeping.keyPrefix, |
| 18560 | func = bookKeeping.func, |
| 18561 | context = bookKeeping.context; |
| 18562 | |
| 18563 | |
| 18564 | var mappedChild = func.call(context, child, bookKeeping.count++); |
| 18565 | if (Array.isArray(mappedChild)) { |
| 18566 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); |
| 18567 | } else if (mappedChild != null) { |
| 18568 | if (isValidElement(mappedChild)) { |
| 18569 | mappedChild = cloneAndReplaceKey(mappedChild, |
| 18570 | // Keep both the (mapped) and old keys if they differ, just as |
| 18571 | // traverseAllChildren used to do for objects as children |
| 18572 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); |
| 18573 | } |
| 18574 | result.push(mappedChild); |
| 18575 | } |
| 18576 | } |
| 18577 | |
| 18578 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { |
| 18579 | var escapedPrefix = ''; |
nothing calls this directly
no test coverage detected