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

Function markStaticRoots

static/vuejs/vue.esm.js:8285–8311  ·  view source on GitHub ↗
(node, isInFor)

Source from the content-addressed store, hash-verified

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

Callers 2

optimizeFunction · 0.70

Calls 1

Tested by

no test coverage detected