(children, nestedIndex)
| 1761 | } |
| 1762 | |
| 1763 | function normalizeArrayChildren (children, nestedIndex) { |
| 1764 | var res = []; |
| 1765 | var i, c, last; |
| 1766 | for (i = 0; i < children.length; i++) { |
| 1767 | c = children[i]; |
| 1768 | if (c == null || typeof c === 'boolean') { continue } |
| 1769 | last = res[res.length - 1]; |
| 1770 | // nested |
| 1771 | if (Array.isArray(c)) { |
| 1772 | res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i))); |
| 1773 | } else if (isPrimitive(c)) { |
| 1774 | if (last && last.text) { |
| 1775 | last.text += String(c); |
| 1776 | } else if (c !== '') { |
| 1777 | // convert primitive to vnode |
| 1778 | res.push(createTextVNode(c)); |
| 1779 | } |
| 1780 | } else { |
| 1781 | if (c.text && last && last.text) { |
| 1782 | res[res.length - 1] = createTextVNode(last.text + c.text); |
| 1783 | } else { |
| 1784 | // default key for nested array children (likely generated by v-for) |
| 1785 | if (c.tag && c.key == null && nestedIndex != null) { |
| 1786 | c.key = "__vlist" + nestedIndex + "_" + i + "__"; |
| 1787 | } |
| 1788 | res.push(c); |
| 1789 | } |
| 1790 | } |
| 1791 | } |
| 1792 | return res |
| 1793 | } |
| 1794 | |
| 1795 | /* */ |
| 1796 |
no test coverage detected