* Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string}
(component, index)
| 18516 | * @return {string} |
| 18517 | */ |
| 18518 | function getComponentKey(component, index) { |
| 18519 | // Do some typechecking here since we call this blindly. We want to ensure |
| 18520 | // that we don't block potential future ES APIs. |
| 18521 | if (typeof component === 'object' && component !== null && component.key != null) { |
| 18522 | // Explicit key |
| 18523 | return escape(component.key); |
| 18524 | } |
| 18525 | // Implicit key determined by the index in the set |
| 18526 | return index.toString(36); |
| 18527 | } |
| 18528 | |
| 18529 | function forEachSingleChild(bookKeeping, child, name) { |
| 18530 | var func = bookKeeping.func, |
no test coverage detected