MCPcopy Create free account
hub / github.com/TruthHun/BookStack / markStaticRoots

Function markStaticRoots

static/vuejs/vue.common.js:8287–8313  ·  view source on GitHub ↗
(node, isInFor)

Source from the content-addressed store, hash-verified

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

Callers 2

optimizeFunction · 0.70

Calls 1

Tested by

no test coverage detected