(bookKeeping, child, childKey)
| 19229 | } |
| 19230 | |
| 19231 | function mapSingleChildIntoContext(bookKeeping, child, childKey) { |
| 19232 | var result = bookKeeping.result, |
| 19233 | keyPrefix = bookKeeping.keyPrefix, |
| 19234 | func = bookKeeping.func, |
| 19235 | context = bookKeeping.context; |
| 19236 | |
| 19237 | |
| 19238 | var mappedChild = func.call(context, child, bookKeeping.count++); |
| 19239 | if (Array.isArray(mappedChild)) { |
| 19240 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); |
| 19241 | } else if (mappedChild != null) { |
| 19242 | if (isValidElement(mappedChild)) { |
| 19243 | mappedChild = cloneAndReplaceKey(mappedChild, |
| 19244 | // Keep both the (mapped) and old keys if they differ, just as |
| 19245 | // traverseAllChildren used to do for objects as children |
| 19246 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); |
| 19247 | } |
| 19248 | result.push(mappedChild); |
| 19249 | } |
| 19250 | } |
| 19251 | |
| 19252 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { |
| 19253 | var escapedPrefix = ''; |
nothing calls this directly
no test coverage detected