(bookKeeping, child, childKey)
| 18427 | } |
| 18428 | |
| 18429 | function mapSingleChildIntoContext(bookKeeping, child, childKey) { |
| 18430 | var result = bookKeeping.result, |
| 18431 | keyPrefix = bookKeeping.keyPrefix, |
| 18432 | func = bookKeeping.func, |
| 18433 | context = bookKeeping.context; |
| 18434 | |
| 18435 | |
| 18436 | var mappedChild = func.call(context, child, bookKeeping.count++); |
| 18437 | if (Array.isArray(mappedChild)) { |
| 18438 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); |
| 18439 | } else if (mappedChild != null) { |
| 18440 | if (isValidElement(mappedChild)) { |
| 18441 | mappedChild = cloneAndReplaceKey(mappedChild, |
| 18442 | // Keep both the (mapped) and old keys if they differ, just as |
| 18443 | // traverseAllChildren used to do for objects as children |
| 18444 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); |
| 18445 | } |
| 18446 | result.push(mappedChild); |
| 18447 | } |
| 18448 | } |
| 18449 | |
| 18450 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { |
| 18451 | var escapedPrefix = ''; |
nothing calls this directly
no test coverage detected