MCPcopy
hub / github.com/processing/p5.js / Else

Method Else

src/strands/strands_conditionals.js:24–36  ·  view source on GitHub ↗
(branchCallback = () => ({}))

Source from the content-addressed store, hash-verified

22 return this;
23 }
24 Else(branchCallback = () => ({})) {
25 this.branches.push({
26 condition: null,
27 branchCallback,
28 blockType: BlockType.IF_BODY
29 });
30 const phiNodes = buildConditional(this.ctx, this);
31 const assignments = {};
32 for (const [varName, phiNode] of Object.entries(phiNodes)) {
33 assignments[varName] = createStrandsNode(phiNode.id, phiNode.dimension, this.ctx);
34 }
35 return assignments;
36 }
37}
38function buildConditional(strandsContext, conditional) {
39 const cfg = strandsContext.cfg;

Callers 2

p5.Shader.jsFile · 0.80
p5.Shader.jsFile · 0.80

Calls 3

createStrandsNodeFunction · 0.90
buildConditionalFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected