(result, newCmptOptions)
| 7425 | } |
| 7426 | |
| 7427 | function mappingByName(result, newCmptOptions) { |
| 7428 | // Mapping by name if specified. |
| 7429 | each(newCmptOptions, function (cmptOption, index) { |
| 7430 | if (!cmptOption || cmptOption.name == null) { |
| 7431 | return; |
| 7432 | } |
| 7433 | |
| 7434 | for (var i = 0; i < result.length; i++) { |
| 7435 | var existing = result[i].existing; |
| 7436 | |
| 7437 | if (!result[i].newOption // Consider name: two map to one. |
| 7438 | // Can not match when both ids existing but different. |
| 7439 | && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual('name', existing, cmptOption)) { |
| 7440 | result[i].newOption = cmptOption; |
| 7441 | newCmptOptions[index] = null; |
| 7442 | return; |
| 7443 | } |
| 7444 | } |
| 7445 | }); |
| 7446 | } |
| 7447 | |
| 7448 | function mappingByIndex(result, newCmptOptions, brandNew) { |
| 7449 | each(newCmptOptions, function (cmptOption) { |
no test coverage detected
searching dependent graphs…