* 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)
| 19028 | * @return {string} |
| 19029 | */ |
| 19030 | function getComponentKey(component, index) { |
| 19031 | // Do some typechecking here since we call this blindly. We want to ensure |
| 19032 | // that we don't block potential future ES APIs. |
| 19033 | if (typeof component === 'object' && component !== null && component.key != null) { |
| 19034 | // Explicit key |
| 19035 | return escape(component.key); |
| 19036 | } |
| 19037 | // Implicit key determined by the index in the set |
| 19038 | return index.toString(36); |
| 19039 | } |
| 19040 | |
| 19041 | function forEachSingleChild(bookKeeping, child, name) { |
| 19042 | var func = bookKeeping.func, |
no test coverage detected