(bookKeeping, child, childKey)
| 1228 | } |
| 1229 | |
| 1230 | function mapSingleChildIntoContext(bookKeeping, child, childKey) { |
| 1231 | var result = bookKeeping.result, |
| 1232 | keyPrefix = bookKeeping.keyPrefix, |
| 1233 | func = bookKeeping.func, |
| 1234 | context = bookKeeping.context; |
| 1235 | var mappedChild = func.call(context, child, bookKeeping.count++); |
| 1236 | |
| 1237 | if (Array.isArray(mappedChild)) { |
| 1238 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) { |
| 1239 | return c; |
| 1240 | }); |
| 1241 | } else if (mappedChild != null) { |
| 1242 | if (isValidElement(mappedChild)) { |
| 1243 | mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as |
| 1244 | // traverseAllChildren used to do for objects as children |
| 1245 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); |
| 1246 | } |
| 1247 | |
| 1248 | result.push(mappedChild); |
| 1249 | } |
| 1250 | } |
| 1251 | |
| 1252 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { |
| 1253 | var escapedPrefix = ''; |
nothing calls this directly
no test coverage detected