(bookKeeping, child, childKey)
| 4270 | PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); |
| 4271 | |
| 4272 | function mapSingleChildIntoContext(bookKeeping, child, childKey) { |
| 4273 | var result = bookKeeping.result; |
| 4274 | var keyPrefix = bookKeeping.keyPrefix; |
| 4275 | var func = bookKeeping.func; |
| 4276 | var context = bookKeeping.context; |
| 4277 | |
| 4278 | var mappedChild = func.call(context, child, bookKeeping.count++); |
| 4279 | if (Array.isArray(mappedChild)) { |
| 4280 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); |
| 4281 | } else if (mappedChild != null) { |
| 4282 | if (ReactElement.isValidElement(mappedChild)) { |
| 4283 | mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, |
| 4284 | // Keep both the (mapped) and old keys if they differ, just as |
| 4285 | // traverseAllChildren used to do for objects as children |
| 4286 | keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey); |
| 4287 | } |
| 4288 | result.push(mappedChild); |
| 4289 | } |
| 4290 | } |
| 4291 | |
| 4292 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { |
| 4293 | var escapedPrefix = ''; |
nothing calls this directly
no test coverage detected