Home / Function/ assertValidBlockNesting() — react Function Reference

assertValidBlockNesting() — react Function Reference

Architecture documentation for the assertValidBlockNesting() function in AssertValidBlockNesting.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8df1c728_cbcd_34ab_bd90_969f45256d13["assertValidBlockNesting()"]
  5dff208f_71b7_72c1_b78a_03be9b621b2a["AssertValidBlockNesting.ts"]
  8df1c728_cbcd_34ab_bd90_969f45256d13 -->|defined in| 5dff208f_71b7_72c1_b78a_03be9b621b2a
  ad41542d_7277_a7c4_02f9_ea27be6345d4["getScopes()"]
  8df1c728_cbcd_34ab_bd90_969f45256d13 -->|calls| ad41542d_7277_a7c4_02f9_ea27be6345d4
  127c19ef_021e_5644_a84e_da0d0ed84999["terminalFallthrough()"]
  8df1c728_cbcd_34ab_bd90_969f45256d13 -->|calls| 127c19ef_021e_5644_a84e_da0d0ed84999
  170cf454_aca5_0b9b_0991_4b81319b731b["recursivelyTraverseItems()"]
  8df1c728_cbcd_34ab_bd90_969f45256d13 -->|calls| 170cf454_aca5_0b9b_0991_4b81319b731b
  style 8df1c728_cbcd_34ab_bd90_969f45256d13 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/AssertValidBlockNesting.ts lines 155–178

export function assertValidBlockNesting(fn: HIRFunction): void {
  const scopes = getScopes(fn);

  const blocks: Array<Block> = [...scopes].map(scope => ({
    kind: 'Scope',
    id: scope.id,
    ...scope.range,
  })) as Array<Block>;
  for (const [, block] of fn.body.blocks) {
    const fallthroughId = terminalFallthrough(block.terminal);
    if (fallthroughId != null) {
      const fallthrough = fn.body.blocks.get(fallthroughId)!;
      const end = fallthrough.instructions[0]?.id ?? fallthrough.terminal.id;
      blocks.push({
        kind: 'ProgramBlockSubtree',
        id: block.id,
        start: block.terminal.id,
        end,
      });
    }
  }

  recursivelyTraverseItems(blocks, block => block, null, no_op, no_op);
}

Subdomains

Frequently Asked Questions

What does assertValidBlockNesting() do?
assertValidBlockNesting() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/AssertValidBlockNesting.ts.
Where is assertValidBlockNesting() defined?
assertValidBlockNesting() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/AssertValidBlockNesting.ts at line 155.
What does assertValidBlockNesting() call?
assertValidBlockNesting() calls 3 function(s): getScopes, recursivelyTraverseItems, terminalFallthrough.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free