(node, isInFor)
| 8279 | } |
| 8280 | |
| 8281 | function markStaticRoots (node, isInFor) { |
| 8282 | if (node.type === 1) { |
| 8283 | if (node.static || node.once) { |
| 8284 | node.staticInFor = isInFor; |
| 8285 | } |
| 8286 | // For a node to qualify as a static root, it should have children that |
| 8287 | // are not just static text. Otherwise the cost of hoisting out will |
| 8288 | // outweigh the benefits and it's better off to just always render it fresh. |
| 8289 | if (node.static && node.children.length && !( |
| 8290 | node.children.length === 1 && |
| 8291 | node.children[0].type === 3 |
| 8292 | )) { |
| 8293 | node.staticRoot = true; |
| 8294 | return |
| 8295 | } else { |
| 8296 | node.staticRoot = false; |
| 8297 | } |
| 8298 | if (node.children) { |
| 8299 | for (var i = 0, l = node.children.length; i < l; i++) { |
| 8300 | markStaticRoots(node.children[i], isInFor || !!node.for); |
| 8301 | } |
| 8302 | } |
| 8303 | if (node.ifConditions) { |
| 8304 | walkThroughConditionsBlocks(node.ifConditions, isInFor); |
| 8305 | } |
| 8306 | } |
| 8307 | } |
| 8308 | |
| 8309 | function walkThroughConditionsBlocks (conditionBlocks, isInFor) { |
| 8310 | for (var i = 1, len = conditionBlocks.length; i < len; i++) { |
no test coverage detected