| 1742 | // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep |
| 1743 | // because functional components already normalize their own children. |
| 1744 | function simpleNormalizeChildren (children) { |
| 1745 | for (var i = 0; i < children.length; i++) { |
| 1746 | if (Array.isArray(children[i])) { |
| 1747 | return Array.prototype.concat.apply([], children) |
| 1748 | } |
| 1749 | } |
| 1750 | return children |
| 1751 | } |
| 1752 | |
| 1753 | // 2. When the children contains constructs that always generated nested Arrays, |
| 1754 | // e.g. <template>, <slot>, v-for, or when the children is provided by user |